Custom Color Schemes in PhpStorm: Optimizing Readability for Long Sessions
AI generated
IDE
{ }
PhpStorm · Editor · Ergonomics
Custom Color Schemes: Readability for Long Sessions
Why a finished theme is rarely enough

Eight hours in front of the editor is not the exception, it is daily routine for PHP developers. A color scheme that feels pleasant in the morning can become a burden by the afternoon. We show how granular tuning in PhpStorm goes beyond simply picking a theme.

15 min read Color Scheme Contrast Eye Strain .icls Export

1. Why Color Scheme Tuning Is More Than Picking a Theme

Anyone who clicks through the list of color schemes in PhpStorm's settings finds Darcula, High Contrast, Light, IntelliJ Light and a handful of community variants. Most developers pick one, maybe adjust the editor font size, and leave it at that. For the first few weeks that is perfectly adequate. After a few months of daily work on Magento codebases with thousands of lines of PHP, XML and JavaScript, it becomes clear that a generic theme does not offer enough visual distinction for certain constructs.

The difference between a finished theme and a self tuned granular scheme lies in precision. A theme covers broad categories: keywords, strings, comments. Granular tuning goes deeper and distinguishes, for example, between a deprecated method, a PHPDoc tag and a plain inline comment. These nuances decide whether the eye can still scan relaxed after hours at the screen, or whether every line of code demands active effort.

2. Where Finished Themes Reach Their Limits

Finished themes are optimized for the average user, not for you personally. Darcula, for instance, uses a green for strings that looks washed out on some poorly calibrated monitors, while keywords and variables share a similar shade of blue. In short scripts this barely matters. In a typical Magento class with dependency injection, several interfaces and nested arrays, the low color difference forces the eye to constantly refocus in order to separate type declarations from variable names.

A second problem is the lack of adaptation to individual viewing habits. Anyone with mild red green weakness or general sensitivity to high saturation gets no option in a standard theme to swap out individual colors without losing the entire scheme. PhpStorm solves this by letting every theme serve as a starting point for your own editable scheme, which can be duplicated under Settings, Editor, Color Scheme and then changed attribute by attribute.

3. Color Scheme and Appearance Theme: the Technical Difference

In PhpStorm two independent settings are often confused: the Appearance Theme under Settings, Appearance and Behavior, Appearance controls the look of the interface, meaning toolbars, icons and dialogs. The Color Scheme under Settings, Editor, Color Scheme, on the other hand, controls only the colors inside the code editor itself, including syntax highlighting, background color and selection colors. Both can be combined independently, a dark UI theme with a light editor scheme is technically no problem at all.

This separation is the lever for granular tuning. A new scheme is created by right clicking an existing scheme and choosing Duplicate. The name should be project or purpose specific, for example Mironsoft Dark Contrast, so it stays clear later which scheme was intended for which use case. From this point on the original theme remains untouched and serves as a fallback if your own adjustments turn out to be a misstep.


Settings > Editor > Color Scheme
  -> gear icon -> Duplicate
  -> Name: "Mironsoft Dark Contrast"
  -> base stays intact, new scheme is independently editable

4. Contrast and Eye Strain in Practice

Eye strain is not primarily caused by dark or light backgrounds, but by contrast that is too high or too inconsistent over long periods. A pure black editor background combined with pure white text creates a contrast value that appears highly legible, but leads to stronger pupil adaptation during hours of fixation than a more muted gray on dark gray combination. For this reason many experienced developers use background colors like 2B2B2B instead of pure black and text colors around E0E0E0 instead of pure white.

The second factor is consistency between related elements. When function names appear in a warm yellow and class names in a cold blue, the brain has to recalibrate every time it switches between the two categories. Shades from the same color family, for example different brightness levels of blue for classes, interfaces and traits, reduce this cognitive load because the distinction happens through brightness rather than hue and is therefore processed faster.

5. Granular Tuning: Adjusting Attribute by Attribute

In PhpStorm's color scheme editor, under Language Defaults and further down under PHP, there is a long list of individual attributes: Keyword, Variable, Function Call, Deprecated Symbol, Doc Comment Tag and many more. Each attribute can be adjusted independently for foreground color, background color, bold, italic and underline. The most common mistake when starting out is changing too many attributes at once and then losing track of which change had which effect.

A more sensible approach is iterative: first adjust only the attributes that appear most frequently in everyday code, such as Variable, Function Declaration and String. After a day or two of practical use it becomes clear whether the new combination actually feels more relaxed. Only then is it worth touching rarer attributes like Static Field or Object Type in Type Hint, since their everyday impact is smaller and premature tuning is often reverted anyway.


Settings > Editor > Color Scheme > PHP
  Variable          -> Foreground #9CDCFE
  Function Call     -> Foreground #DCDCAA
  Deprecated Symbol -> Strikethrough + #808080
  Doc Comment Tag   -> Foreground #808080, Italic

6. Highlighting PHP and Magento Specific Attributes

In Magento codebases, certain constructs are especially relevant for readability: PHPDoc blocks with @param, @return and @throws, deprecated methods from older Magento versions, and type hints in constructor signatures using constructor property promotion. PhpStorm offers a dedicated category for Deprecated Symbol, which by default only shows a strikethrough. An additional gray tint makes it visible at a glance which method should no longer be used, without having to read the text first.

For type hints, a deliberate distinction between the Class Reference and Instance Field attributes is worth setting up, so an injected repository interface in the constructor stays visually distinguishable from a local property. Anyone working heavily with view models and service contracts also benefits from rendering interface names in a slightly lighter variant of the class color, so it is immediately clear whether something is a concrete implementation or a contract.

7. Exporting Schemes and Keeping Teams Consistent

An individually tuned color scheme is valuable only if it does not get lost. PhpStorm stores color schemes as .icls files in XML format under the IDE's configuration folder. Via Settings, Editor, Color Scheme and the export button, your scheme can be saved as a file and imported into another project or a fresh PhpStorm installation. For teams it is worth placing this file, together with other project specific IDE settings, in its own folder within the repository, for example under .idea-shared instead of the ignored .idea directory.

Consistency across a team does not mean everyone has to use exactly the same colors. A shared baseline from which every developer can make smaller adjustments for their own perception is more sensible. What matters most is that safety relevant highlights, such as deprecated code or invalid syntax, remain clearly recognizable in every individual variant, so code reviews work reliably regardless of personal scheme choices.

8. Interaction With Font Choice and Ligatures

A color scheme never works in isolation, it always interacts with the chosen font. Monospace fonts like JetBrains Mono or Fira Code offer optional ligatures, where character sequences such as arrow operators or comparison operators merge into a single visual symbol. Combined with a well tuned color scheme, this noticeably reduces the number of individual elements the eye has to process. Ligatures are enabled under Settings, Editor, Font via the Enable Ligatures checkbox.

Font size itself also influences how a color scheme performs: at sizes below 12 points, subtle color differences wash out faster because individual characters occupy less area. Anyone who notices during long sessions that colors become harder to distinguish over time should first check font size and line spacing under Settings, Editor, Font before making further color adjustments, since both factors reinforce each other.

9. Practical Setup: Building Your Own Scheme Step by Step

A sensible starting point is an existing dark theme as a base, since dark backgrounds are generally perceived as more comfortable under artificial light. After duplicating the scheme, the first step is adjusting the base colors for background and default text, followed by the three to five most frequently occurring PHP attributes. Only in a third step come detail adjustments for Deprecated Symbol, Doc Comment and XML specific attributes, which are relevant in layout files and configuration XML.

The table below compares three common approaches to color scheme tuning in PhpStorm regarding effort, degree of control and suitability for long sessions. It shows that the full benefit is only achieved with granular tuning, while simply picking a theme is the fastest but least precise path. For teams doing daily Magento development, the extra effort of the granular approach usually pays off within a few weeks.

Approach Effort Degree of Control Suitability for Long Sessions
Use a finished theme as is Minimal Low Sufficient for occasional use
Lightly adjust base colors Low Medium Good for most everyday cases
Granular attribute tuning Medium to high High Very good, noticeably less fatigue
Team wide scheme via .icls High (one time) High, shared Optimal for consistent code reviews

Mironsoft

PhpStorm setup, Docker integration, and team productivity

PhpStorm that actually runs optimally for Magento and PHP projects?

We review existing PhpStorm setups for slow indexing, unused Docker integration, and missing team conventions, then set up a configuration that is productive from the first second.

Setup Review

Optimizing indexing, interpreter, and memory settings for large Magento projects.

Docker Integration

Cleanly connecting Xdebug, PHPUnit, and database tools to the Docker setup.

Team Conventions

Standardizing inspection profiles, code style, and live templates project-wide.

10. Summary

Color Schemes in PhpStorm: The Key Facts at a Glance

Separation

Appearance Theme and Editor Color Scheme are configured independently.

Contrast

Muted contrast instead of pure black and white noticeably reduces eye strain.

Granularity

Individual PHP attributes like Deprecated Symbol can be colored independently.

Sharing

Schemes export as .icls files and stay consistent across the team.

11. FAQ: Color Schemes in PhpStorm: The Key Facts at a Glance

1Where do I find the color scheme settings in PhpStorm?
Under Settings, Editor, Color Scheme. There you can duplicate an existing scheme via the gear icon and then customize it freely without changing the original.
2Is the Appearance Theme the same as the Color Scheme?
No. The Appearance Theme controls the IDE interface, meaning toolbars and dialogs. The Color Scheme only affects colors inside the code editor and is configured separately.
3Why is a finished theme like Darcula often not enough?
Finished themes are optimized for the average user. In complex codebases with many similarly colored constructs, the coarse distinction is often not enough for fast scanning.
4Which colors help most against eye strain?
Muted contrast instead of pure black and white, such as dark gray instead of black and light gray instead of white, plus consistent hues within related categories like classes and interfaces.
5How do I export my color scheme for colleagues?
Via Settings, Editor, Color Scheme and the export button, the scheme is saved as an .icls file that can be imported and shared across the team.
6Should the whole team use the same color scheme?
Not necessarily identical, but a shared baseline makes sense. What matters is that safety relevant highlights like deprecated code stay clearly recognizable in every variant.
7Which PHP attributes are worth adjusting first?
The most frequent constructs in everyday code: Variable, Function Call and String. Rarer attributes like Static Field are only worth touching after a test phase with the base attributes.
8Do font choice and ligatures affect the color scheme?
Yes. Ligatures and an adequate font size reduce the number of visual elements and further amplify the effect of a well tuned color scheme.
9Can I change individual colors without losing the whole theme?
Yes, that is exactly the advantage of a duplicated scheme. It stays fully editable while the original theme remains available as a fallback.
10How do I know if my color scheme is actually helping?
Best measured through a one to two week test phase with deliberate observation of whether afternoon fatigue appears later or weaker than before.