-
Notifications
You must be signed in to change notification settings - Fork 118
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
compiled emacs with srgb, separator colors are wrong #54
Comments
I have the same problem. on OS X 10.9, emacs-bzr-version: 116475. |
I remember this being an issue but in not sure what the fix is.
|
Same problem +1 to a solution |
same still have problem! |
Yeah, i don't have a solution to this problem. It's the fact that whatever On Tue, Jul 29, 2014 at 9:04 AM, Ray H notifications@github.com wrote:
|
I have the same problem with emac 24.4.50.1 |
+1, using 24.4 on OS X. I didn't explicitly compile emacs with srgb but I think it's default in 24.4? |
+1, 24.4 on OS X. |
Known issue. Nothing we can do really unless we detect it, we currently
|
You can turn off sRGB to make the colors look right. (setq ns-use-srgb-colorspace nil) |
Thanks @jupl that worked for me. |
@jupl This works for me too, but can u basically explain why? |
@chiangqiqi I think @jupl’s change basically makes the colors “wrong” for the rest of Emacs as well, so they match the colors used by the pixmaps. There are many colorspaces – sRGB is one of them. Disabling the use of sRGB switches to an uncorrected colorspace, which is what the image generation program must be using as well. So, turning off sRGB will make all your Emacs colors slightly off, but at least it will match. I had the opposite of this problem with sellout/emacs-color-theme-solarized, back when Cocoa Emacs didn’t support sRGB at all, and users would complain that the theme colors were wrong (but with an uncorrected space, the right colors had slightly different values on different machines, so fixing them for one user could make them worse for another user). I don’t have a solution here, unfortunately. But I’ll look into it. |
Oh, another workaround is to use UTF-8 separators, then you don’t have the issue with XPM colors. The best separators I’ve found are ►/◄ (#x25ba / #x25c4) – please let me know if you find others that look better! |
The graphics are generated as |
For anyone interested, this is the workaround I'm currently using to get the colours to look good under sRGB: http://irrationalrose.com/2015/05/29/workaround-for-srgb-colour-issue-for-powerline-on-os-x.html |
emacs-mac port also works. https://github.com/railwaycat/homebrew-emacsmacport |
@jupl 👍 |
This is why I disabled separators completely, pixmap separators have wrong background colour and looks ugly on Retina display, and UTF-8 separators are missed in most fonts (I change frame font quite frequently because due to my nature things quickly bored me). Oh, by the way recently I have found that it's totally easy and OK to customize mode-line face setting height and font family different to default face. |
There is a bug in the MacOS version of Emacs which draws all images using the Apple RGB color space. This was fine back in the days, but newer OSX versions default to the sRGB color space. So while Emacs uses correct colors for the text area, it uses wrong color for the XPM images used by powerline. I have written a patch, which works around the issue by converting sRGB colors to Apple RGB colors before XPM generation. I have added an options (which is off by default) to enable the workaround. YMMV. |
Fixes #54. Adds a custom option 'powerline-image-apple-rgb', which should be set to 't' to enable the workaround. When the option is set, powerline's XPM images are generated using equivalent Apple RGB colors, instead of the regular sRGB colors. This is not needed on the Emacs-mac port, or when Apple RGB colors are used by setting 'ns-use-srgb-colorspace' to nil.
@jupl |
@anuragm Thanks! With Origin behaviour (wrong powerline separator): With In my experience the separator uses the same color as the text part, so it's perfect but not like a workaround. While non-SRGB solution makes the whole Emacs UI feels lighter and faded (also look at the background above the powerline), there's no reason to recommend it anymore. The only confusion for me is, Is the whole powerline (both text and separator image) uses Apple RGB but not SRGB? |
@darkbaby123 With the workaround, everything in powerline uses sRGB color space, which is the color space usually targeted by the theme authors . The problem arises due to Emacs using sRGB colorspace for everything except XPM image generation, where it uses the default color space. On MacOS, default is Apple RGB color space (due to historical reasons) while it is sRGB on Linux and Windows. So the same triplet of RGB values look different on screen on MacOS, but look correct on the other two OS. To fix the issue, we can do one of the two things: This problem really needs to be fixed in Emacs, and has been fixed in the Mac port (where we don't require this workaround). In that sense, it is proper to call this "fix" a workaround. When (if?) Emacs upstream fixes the issue or if MacOS changes its default color space, we'd have to turn this option off to get correct colors. I really tried tinkering with Emacs code, but Thanks for the report about the new Macbook. The default color space is still Apple RGB if the workaround is still working. |
@anuragm Thanks for detailed explanation! |
Thanks to this issue: milkypostman/powerline#54
This is a wrapper around `moody-slant' that manipulates the colors so that they use the equivalent Apple RGB colors instead of the regular sRGB colors. This appears to be necessary because Emacs on macOS uses a color space for XPM images than for other things. Usage: (setq moody-slant-function #'moody-slant-apple-rgb). Re #2. This is a port of the equivalent hack used by Powerline. See milkypostman/powerline#54 and milkypostman/powerline#141.
This is a wrapper around `moody-slant' that manipulates the colors so that they use the equivalent Apple RGB colors instead of the regular sRGB colors. This appears to be necessary because Emacs on macOS uses a color space for XPM images than for other things. Usage: (setq moody-slant-function #'moody-slant-apple-rgb). Re #2. This is a port of the equivalent hack used by Powerline. See milkypostman/powerline#54 and milkypostman/powerline#141.
@Arelav finally! thank you for this it should be in the documentation!! |
Hallo!
I compiled emacs24 on my mac with homebrew and the srgb option
(https://github.com/Homebrew/homebrew/blob/master/Library/Formula/emacs.rb)
Now using powerline the colors of the separators don't match the color-theme anymore.
Is there away to get them right?
Cheers!
The text was updated successfully, but these errors were encountered: