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

Set apple color space automatically #157

Merged
merged 4 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion powerline-separators.el
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,18 @@
(require 'cl-lib)
(require 'color)

(defvar powerline-image-apple-rgb)
(defvar powerline-image-apple-rgb
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not a defcustom here?

(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.
Expand Down
9 changes: 0 additions & 9 deletions powerline.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down