Enable dark theme on arduino IDE

Introduction

If you are an Arduino developer, you probably spend hours staring at the screen while writing code and debugging circuits. The default white background of the Arduino IDE can cause significant eye strain, especially during late-night sessions.

Fortunately, whether you are using the classic Arduino IDE 1.8.x or the modern Arduino IDE 2.x, enabling Dark Mode is easy. In this guide, we will look at how to switch to a darker theme to protect your eyes and give your workspace a professional look.



Why Use Dark Mode for Coding?

Beyond just looking "cool," Dark Mode offers several technical and health benefits:

  1. Reduced Eye Strain: High-contrast white backgrounds can cause "computer vision syndrome." Darker themes reduce the intensity of blue light.

  2. Improved Focus: Many developers find that syntax highlighting (the colors of your code) is easier to read against a dark background.

  3. Battery Saving: If you are coding on a laptop with an OLED screen, dark mode can actually help extend your battery life.

Themes ðŸ‘‡



Method 1: Enabling Dark Mode in Arduino IDE 2.0 (The Modern Way)

The newer version of the Arduino IDE has built-in support for themes, making the switch very simple.

  1. Open Arduino IDE 2.0.
  2. Go to File > Preferences (on Windows) or Arduino IDE > Settings (on macOS).
  3. Look for the Theme dropdown menu.
  4. Select "Dark (Arduino)" or "Theia Dark."
  5. Click OK, and the interface will update immediately.

[Image: Screenshot of Arduino IDE 2.0 Preferences window highlighting the Theme menu]


Method 2: Enabling Dark Mode in Arduino IDE 1.8.x (Classic Version)

The classic version does not have a "one-click" dark mode setting. Instead, you have to replace the theme files manually or download a custom community theme.

Step-by-Step Manual Update:

  1. Download a Theme: Go to GitHub and search for "Arduino IDE Dark Theme" (One popular version is by emericpoulin).
  2. Locate the Theme Folder: 
    • On Windows: C:\Program Files (x86)\Arduino\lib\theme
    • On macOS: Right-click the Arduino App > Show Package Contents > Contents/Java/lib/theme
  3. Backup your files: Copy the original theme folder to your desktop as a backup.
  4. Replace the files: Extract the downloaded Dark Theme files into the lib folder, replacing the old theme folder.
  5. Restart the IDE: Open Arduino, and you will see the new dark interface.


Customizing Syntax Highlighting

Sometimes, even with Dark Mode, you might want to change the colors of your variables or functions.

  • In the theme folder, there is a file called theme.txt.
  • Advanced users can edit the Hex color codes (e.g., #FFFFFF for white) in this file to customize the look of the editor.
  • Warning: Always keep a backup of theme.txt before making changes!


⚠️Troubleshooting Common Issues

1. The Theme Didn't Change

If you followed the steps for Version 1.8 and nothing changed, ensure you replaced the entire folder. If the folder structure is wrong (e.g., lib/theme/theme/), the IDE will default back to the light version.

2. Text is Hard to Read

Some custom themes have low contrast. If you find the text difficult to see, try a different community theme or switch back to the default "Dark (Arduino)" theme if you are using IDE 2.x.

3. Icons are Still White

In the older 1.8 version, some icons are images (.png). If the custom theme you downloaded didn't include dark-compatible icons, they might still look bright. This is why upgrading to Arduino IDE 2.x is the best solution for a perfect Dark Mode experience.



Conclusion

Setting up a Dark Theme is a simple step that makes a huge difference in your productivity and health. Whether you prefer the modern IDE 2.0 or the classic 1.8, you no longer have to code in a bright white environment.

What do you think? Do you prefer Dark Mode or the classic Light Mode? Let me know in the comments below!

Post a Comment

Post a Comment (0)

Previous Post Next Post