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:
|
||||
|
||||
* A cterm color index.
|
||||
* A list of two integers, where the first integer is a cterm color
|
||||
index, and the second is an RGB/hex color. This is useful for
|
||||
colorschemes that use colors that aren't available in color terminals.
|
||||
* A list with a cterm color index and a hex color string (e.g. ``[123,
|
||||
"aabbcc"]``). This is useful for colorschemes that use colors that
|
||||
aren't available in color terminals.
|
||||
|
||||
``groups``
|
||||
.. _config-colorscheme-groups:
|
||||
|
|
|
@ -12,7 +12,7 @@ class Colorscheme(object):
|
|||
# Create a dict of color tuples with both a cterm and hex value
|
||||
for color_name, color in colorscheme['colors'].items():
|
||||
try:
|
||||
self.colors[color_name] = (color[0], color[1])
|
||||
self.colors[color_name] = (color[0], int(color[1], 16))
|
||||
except TypeError:
|
||||
self.colors[color_name] = (color, cterm_to_hex[color])
|
||||
|
||||
|
|
Loading…
Reference in New Issue