mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 23:35:04 +02:00
Use hex strings for RGB colors in colorschemes
Previously you'd have to convert a hex number to an integer, this change makes it possible to use a hex string instead which is much more useful.
This commit is contained in:
parent
6ac9f0d602
commit
e49f760510
@ -99,9 +99,9 @@ Colorschemes
|
|||||||
color, and the value is one of the following:
|
color, and the value is one of the following:
|
||||||
|
|
||||||
* A cterm color index.
|
* A cterm color index.
|
||||||
* A list of two integers, where the first integer is a cterm color
|
* A list with a cterm color index and a hex color string (e.g. ``[123,
|
||||||
index, and the second is an RGB/hex color. This is useful for
|
"aabbcc"]``). This is useful for colorschemes that use colors that
|
||||||
colorschemes that use colors that aren't available in color terminals.
|
aren't available in color terminals.
|
||||||
|
|
||||||
``groups``
|
``groups``
|
||||||
.. _config-colorscheme-groups:
|
.. _config-colorscheme-groups:
|
||||||
|
@ -12,7 +12,7 @@ class Colorscheme(object):
|
|||||||
# Create a dict of color tuples with both a cterm and hex value
|
# Create a dict of color tuples with both a cterm and hex value
|
||||||
for color_name, color in colorscheme['colors'].items():
|
for color_name, color in colorscheme['colors'].items():
|
||||||
try:
|
try:
|
||||||
self.colors[color_name] = (color[0], color[1])
|
self.colors[color_name] = (color[0], int(color[1], 16))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.colors[color_name] = (color, cterm_to_hex[color])
|
self.colors[color_name] = (color, cterm_to_hex[color])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user