Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base03 color is not dark enough in Idea12CE #46

Closed
gsshiva opened this issue May 28, 2013 · 28 comments
Closed

base03 color is not dark enough in Idea12CE #46

gsshiva opened this issue May 28, 2013 · 28 comments

Comments

@gsshiva
Copy link

gsshiva commented May 28, 2013

The background color is correctly set to base03 in the Solarized pallete appears to be lighter compared to the color on other apps, like iTerm2 (MacOS) and Vim. See attached picture of iTerm2 and Idea12CE. The same issue appears on Windows 7 as well. Not sure what the issue could be. BTW, I see the same issue with the the IntelliJ colors on main (https://github.com/altercation/solarized) repository as well. What gives ?
solarized-idea12

@jkaving
Copy link
Owner

jkaving commented Jun 3, 2013

I don't know what causes this - but I see the same thing (on Mac OS X).

The RGB values for the colors are entered correctly in the IntelliJ IDEA color scheme so my guess is that IntelliJ IDEA for some reason renders the color differently.

Since the source code for IntelliJ IDEA is freely available (https://github.com/JetBrains/intellij-community) I guess it should be possible to figure out how the rendering is done.

@jkaving
Copy link
Owner

jkaving commented Jun 4, 2013

I wrote a small test program that just shows a JPanel with the base03 color (RGB 0,43,54) as background.
This is rendered correctly:

solarized_idea_xscope

Using xScope I can see that the test program uses the correct color but IntelliJ IDEA is showing the background as RGB 0,57,69 instead.

Perhaps I should open an issue in the IntelliJ IDEA bug tracker and ask what is causing this.

@jkaving
Copy link
Owner

jkaving commented Jun 4, 2013

I have created IDEA-108424 in the IntelliJ IDEA bug tracker.

@gsshiva
Copy link
Author

gsshiva commented Jun 4, 2013

Thanks for looking into this. BTW, I also sampled the image with MSPaint and I see that the color that is rendered by IDEA is 0,57,70. Thanks for filing a bug with IDEA.

BTW, on a linux IDea12, it does render it correctly. This incorrect rendering is only on a Mac and Windows (7). I will also try to check out IDEA on my Linux VM on the mac.

@nickgzzjr
Copy link

Is there a solution to this problem? I'm experiencing the same problem with any color scheme I use. It looks like its rendering all the colors lighter.

@jkaving
Copy link
Owner

jkaving commented Jan 8, 2014

No, unfortunately not.
There is no response on the Youtrack issue and I have not been able to figure out why this happens.

Which OS are you using?

@nickgzzjr
Copy link

I'm using OSX 10.9. I noticed that if you use the droplet to change the color inside the editor preference, it gets incorrect hex values but the color itself is much closer.

@jkaving
Copy link
Owner

jkaving commented Jan 9, 2014

Interesting.
The eyedropper in IntelliJ IDEAs color dialog shows different values than xScope.
xScope shows the base03 color on the Solarized website as RGB 0,43,53, while IntelliJ IDEAs eyedropper shows it as RGB 15,40,48.

@dappa
Copy link

dappa commented Jan 30, 2014

I've converted all the colors via droplet tool and Photoshop and added it to a fork called Solarized Darker: https://github.com/dappa/intellij-colors-solarized

Here is a comparison:
comparison
Darker theme to the left.

@jkaving
Copy link
Owner

jkaving commented Feb 10, 2014

Running IntelliJ IDEA using Java 7 or 8 (using this procedure) seems to eliminate the problem and make the colors correct.

Unfortunately, for me, this leads to some other problems:

@geoelectric
Copy link

I think the problem may lie in OS X's color management.

I played with ColorSync a bit (I don't have xScope) and I get 0, 57, 69 for the background of PyCharm as rendered in sRGB, which is obviously off from 0, 43, 54 canonical. However, if I put in a Generic RGB of 0, 43, 54 and convert it back to sRGB in ColorSync's calculator, I get 0, 57, 87.

Similarly, if I take the gutter, it's 6, 70, 83 on PyCharm vs. 7, 54, 66 canonical. Doing the same exercise, Generic 7, 54, 66 is 1, 70, 84 sRGB.

I know these aren't exact, but that strikes me as close enough to suggest that IntelliJ might be setting its colors in Generic RGB instead of the current system profile, and they're getting translated.

In comparison, measuring Sublime Text, Textual, Terminal, and the website, I get 0, 43, 53/54 sRGB for the background (and so forth).

I wonder if a base color of 2, 32, 41 for IntelliJ might not work on OS X--if applied in Generic that would be 0, 43, 54 sRGB by my calculator. That may be specific to my color profile, but I'm using Apple's generic profile so that might cover a majority case.

Unfortunately, I'm on PyCharm, and am a little clueless as to what to do with the java portions of rebuilding the jar (how to go from xml->icls?) so haven't tried it out. If it's easy for someone, I'd be pretty curious. It'd be nice to get the theme looking like my other (accurate) Solarized apps.

FWIW I think the main site recognizes the issue in the Apple Color Palette section of the distro where there's a technical explanation of this.

@geoelectric
Copy link

Just stumbled across how to edit my own colors in IDE (hi, I'm new :) )

I'd say this is a success. I set the background for 2, 32, 41 and the gutter background to 10, 41, 51 in the IDE color picker.

Now they eye-dropper (per ColorSync) in sRGB at 2, 43, 54 and 10, 54, 66.

Despite the discrepancy, it's visually almost identical to my other themes (and the website). See the attached pic at bottom of PyCharm in front of Sublime Text.

I'll be interested to know if these results repeat on other machines with different color profiles using the same verbatim numbers or whether each machine has a different translation offset. I'll probably try it at work in the next couple of days.

screen shot 2014-07-15 at 12 34 53 am

@aik099
Copy link
Contributor

aik099 commented Jul 15, 2014

The problem is only with background and gutter colors or with all colors?

@aik099
Copy link
Contributor

aik099 commented Jul 15, 2014

Here is how the same file looks in PhpStorm (too light colors) and in Sublime Text 2:
phpstorm_toolight
Looks like all colors have shifted somehow in comparison with original colors.

@jkaving did you have same effect when you set the colors to the theme?

@geoelectric
Copy link

I suspect it's with all colors, if the problem is what I think it is, unless they somehow use a different coloring mechanism for font rendering than the background.

That said, the syntax highlighting looks closer than the backgrounds did. However, I'm not sure the color difference would be as apparent with the thin, blurred lines of anti-aliased fonts. They are a bit different hue than Sublime's version, but I haven't compared either to the website to know if they're non-canonical.

I did peek at Solarized Light at one point too, and its background is similarly off. It's just not as obvious with a light color that it's slightly lighter.

If the offset numbers do turn out to be portable (at least between generic sRGB and MBP/iMac profiles) I might try a full overhaul of the theme. Worse to worse I can do it via IDE then export it, maybe figure out how to merge it in here.

@aik099
Copy link
Contributor

aik099 commented Jul 15, 2014

Another screenshot (with xScope) to show that color is displayed incorrectly by PhpStorm:
phpstorm_pickedcolormismatch

I've also opened issue for PhpStorm: http://youtrack.jetbrains.com/issue/WI-24044

@geoelectric
Copy link

Yeah, if you xScope the backgrounds of the screenshot I attached above (mind the drop-shadow below the top window), you'll see that they're much more consistent after entering the values as Generic RGB equivalents.

I'm 99% sure that's the issue--IntelliJ's RGB isn't color-management aware in whatever way the other native Mac apps are, so the colors are getting applied as generic values instead of device values.

@jkaving
Copy link
Owner

jkaving commented Jul 15, 2014

@geoelectric & @aik099 - Thanks for investigating this further.

You are probably correct that it is related to color profiles.
I did the opposite test by switching the color profile for my monitor to Generic RGB - and now I get the correct colors:
screenshot of colorsync-verktyg 2014-07-15 10 31 21

If found a bug reference in Apple's release note for an earlier Java update that might be related:

Radar #8321523

Java should not use device-dependent color correction.

Description:

Java uses the color correction profile of the primary display device to express its color rendering intent to the native graphics system. The colors used by the AWT are actually in the generic or sRGB colorspace, and should not be interpreted as already device-correct.

Workaround:

Change the color profile of the primary display to "Generic" in the Displays preference pane.

Resolution:

This issue has been resolved in Java SE 6. Sampled colors on screen using the Robot may no longer match the same literal RGB values used in the Java app. There are also performance penalties for translating images between different colorspaces.

@geoelectric
Copy link

Yep, that's it then. I have a different monitor at the office, and can try this on an rMBP and MBA too.

If we're lucky, the colors work the same way on at least the generic profiles and we can fork the theme for OS X with offset colors. If it turns out that the offsets are different, maybe there is a compromise value that isn't quite so noticeable in the 80+% case.

Alternately, maybe there's a way to programmatically calculate the colors against the current system's profile and a script can generate a custom theme for the local system as a deployment step.

Weird that you saw the issue disappear with 7 or 8--the way the bug is written sounds like the problem should have appeared in 6 and then persisted from there. I don't suppose that might have been switching away from the Apple-provided Java to Oracle's, given the other bugs you saw? If this is an Apple-only bug, that fix may only have been applied in OS X's distros.

@aik099
Copy link
Contributor

aik099 commented Jul 15, 2014

I don't remember if I was using Solarized theme in PhpStorm 6, but surely there problem is there for both 7x and 8x versions of PhpStorm.

@geoelectric
Copy link

Sorry, that was unclear attribution on my part. I meant where @jkaving had previously tried it with different Java versions.

Running IntelliJ IDEA using Java 7 or 8 (using this procedure) seems to eliminate the problem and make the colors correct.

@jkaving
Copy link
Owner

jkaving commented Jul 15, 2014

I just downloaded the IntelliJ IDEA 14 EAP version with bundled Java 7.
It does not have the problem - so it might very well be a difference in the color handling between Apple's Java and the newer Oracle versions.

@aik099
Copy link
Contributor

aik099 commented Jul 15, 2014

Unfortunately for Mac version the IDEA/PhpStorm uses Apple's Java and there is no way to change it.

I've tried to download Java 7 and made PhpStorm 8 use it, but a lot of other problems with UI popped up, so I switched back.

@geoelectric
Copy link

Following up. Sorry for the delay. I honestly haven't tried PyCharm at work, which is what I was waiting for. That said, I can speak to the situation pretty well.

As it turns out, when I calibrated my new monitor at work, all the colors went off between Terminal, Sublime, and Textual (my three other Solarized apps). More specifically, Sublime and Textual stayed the same, but Terminal got darker. Think my conclusion there is either Sublime and Textual are using device RGB and Terminal, using tomislav's profiles, is using sRGB; or vice-versa. Think it's the former, since the colors looked more right on the first two.

When I switched to either uncalibrated MacBook Pro profile or sRGB, the difference went away. Same with uncalibrated iMac or sRGB at home.

So, some takeaways:

  1. Mac Java is using Generic RGB, at least the version in current PyCharm and (free) IDEA. EAP may be different. To make those look right, the colors need to be reset to the generic RGB equivalents of the correct device colors, as mentioned above.

  2. However, you're only guaranteed consistency between PyCharm/IDEA and other apps in sRGB, since there appears to be a mishmash of device/sRGB going on between their themes. The way to get around that is to set your monitor profile to sRGB, so device == sRGB.

  3. The default Mac color profiles, at least for rMBP and iMac, appear to actually be sRGB or close to it. The "device" colors only differed by a point or two in one of the channels doing eyedropper spot checks between the profiles.

I'll check that on MBA when I do get a chance, since I know it has a lower native color gamut than the two I mention--around 60% of sRGB instead of the 99% sRGB on the better screens. Its default calibration might be further away from sRGB.

In terms of what seems appropriate going forward, could:

A) do nothing and wait for IDEA 14 to hit mainstream. From what @jkaving says, it ends up using device RGB instead of generic (whether right or wrong) and the problem doesn't exist.

B) create a fork with adjusted colors, assuming generic RGB values against an sRGB profile. That would at least tide people over for now, and would be nice for those who don't stay on JetBrain's update train for the paid stuff.

...and in either case, looks like Mac Solarized developers who don't need absolute color consistency might want to calibrate their monitors to sRGB (including setting emulation in the monitor itself, if that's an option for you) or at least use the generic profiles that seem to approximate it.

This obviously won't work for the visual designers out there, but seems to tame the different themes assuming they use either sRGB or Device, and not Generic.

@geoelectric
Copy link

I did eventually check this on MacBook Air, btw--its defaults are very far away from sRGB. Going to that color profile gave a blue cast to the screen, and isn't a tenable workaround. Upshot is that it's going to have issues with Solarized consistency between apps pretty much no matter what, though aligning on device RGB would fix that.

@jkaving
Copy link
Owner

jkaving commented Feb 10, 2015

As mentioned before - this problem is fixed for me when running IntelliJ IDEA with Java 7 or 8.

There is now an early access version of IntelliJ IDEA 14.1 using a bundled custom-built Java 8 JDK at https://confluence.jetbrains.com/display/IDEADEV/IDEA+14.1+EAP

With this version I don't get the other problems i got using a newer JDK (shortcut commands using 'Alt' not working, screen flickering etc.).

@geoelectric
Copy link

As a final followup, I did end up trying out the PyCharm with bundled Java 8, and the problem went away there as well (no big surprise given the last comment). I don't see any other issues introduced, so I'll stick with this.

@jkaving
Copy link
Owner

jkaving commented Dec 21, 2015

Closing this issue since the problem has been fixed by IntelliJ versions bundling Java 8.

@jkaving jkaving closed this as completed Dec 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants