diff --git a/powerline-separators.el b/powerline-separators.el index ef5edd3..5bce7e0 100644 --- a/powerline-separators.el +++ b/powerline-separators.el @@ -29,7 +29,18 @@ (require 'cl-lib) (require 'color) -(defvar powerline-image-apple-rgb) +(defvar powerline-image-apple-rgb + (and (eq (window-system) 'ns) + ns-use-srgb-colorspace + (< 11 + (string-to-number + (and (string-match "darwin\\([0-9]+\\)" system-configuration) + (match-string-no-properties 1 system-configuration))))) + "Boolean variable to determine whether to use Apple RGB colorspace to render images. + +t on macOS 10.7+ and `ns-use-srgb-colorspace' is t, nil otherwise. + +This variable is automatically set, there's no need to modify it.") (defun pl/interpolate (color1 color2) "Interpolate between COLOR1 and COLOR2. diff --git a/powerline.el b/powerline.el index 3cb8f0f..70e757a 100644 --- a/powerline.el +++ b/powerline.el @@ -138,15 +138,6 @@ This is needed to make sure that text is properly aligned." :group 'powerline :type 'boolean) -(defcustom powerline-image-apple-rgb nil - "When t, Use Apple RGB colors for image generation. - -On MacOS, sRGB colors are used for all GUI elements, except for image generation -which uses Apple RGB color space. When this option is set, theme colors are -converted to equivalent Apple RGB colors before image generation." - :group 'powerline - :type 'boolean) - (defcustom powerline-gui-use-vcs-glyph nil "Display a unicode character to represent a version control system. Not always supported in GUI." :group 'powerline