-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Separators have weird colors #2
Comments
A major reason why I wrote But there is already an option |
That sounds extremely reasonable :) I’ll give it a shot! Thanks! |
Ok, so the following code fixes the issue: ;; pl functions copied from powerline
;; https://github.com/milkypostman/powerline/blob/master/powerline-separators.el
(defun pl/color-xyz-to-apple-rgb (X Y Z)
"Convert CIE X Y Z colors to Apple RGB color space."
(let ((r (+ (* 3.2404542 X) (* -1.5371385 Y) (* -0.4985314 Z)))
(g (+ (* -0.9692660 X) (* 1.8760108 Y) (* 0.0415560 Z)))
(b (+ (* 0.0556434 X) (* -0.2040259 Y) (* 1.0572252 Z))))
(list (expt r (/ 1.8)) (expt g (/ 1.8)) (expt b (/ 1.8)))))
(defun pl/color-srgb-to-apple-rgb (red green blue)
"Convert RED GREEN BLUE colors from sRGB color space to Apple RGB.
RED, GREEN and BLUE should be between 0.0 and 1.0, inclusive."
(apply 'pl/color-xyz-to-apple-rgb (color-srgb-to-xyz red green blue)))
(defun linus/hex-to-apple-rgb-hex (hex)
(apply #'color-rgb-to-hex
(apply #'pl/color-srgb-to-apple-rgb (color-name-to-rgb hex))))
(defun linus/moody-slant (direction c1 c2 c3 &optional height)
(apply
#'moody-slant
direction
(linus/hex-to-apple-rgb-hex c1)
(linus/hex-to-apple-rgb-hex c2)
(linus/hex-to-apple-rgb-hex c3)
height))
(setq moody-slant-function 'linus/moody-slant) |
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.
I have decided to add this anyway, but only after stuffing everything into a single function. |
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.
Oh, nice! Thanks a lot! :) |
I'm experimenting with using moody with the zenburn theme on macOS. However, the slants have some weird colors.
Config:
Looks like this:
I don't know if it's the same issue as the one in Powerline, regarding Emacs using different color spaces on macOS for XPM and all other GUI elements, which was fixed here:
milkypostman/powerline@8a24690
What do you think?
Update
It seems to be the same issue. Adding
(setq ns-use-srgb-colorspace nil)
fixes it. However, that makes the rest of my theme look a bit off so I'd rather not do that.Would it be possible to implement a similar fix as in powerline?
The text was updated successfully, but these errors were encountered: