I found out your issue with RGB. You should only refer to your colors in hex throughout. Don’t save colors in theme as RGB, or color name; just hex. This is invalid in the theme file 255,255,0. The commas cause it to fail. RGB will not get colored. Be consistant. Since you are already converting everything to hex, let that be the way you save them all, and reference them all since it will work without issue in the theme file. Remove all of the other referencing. I have always found that simplicity makes my life easier in coding. The less things I have to keep track of, the better. I would even go as far to make sure to convert 3 char hex to 6 char hex (#3f3 -> #33ff33)
For example just changing these two functions below to only reference the color.hex portion allowed RGB, color names, and hex to work.
[code]def template(color):
“”“Template dict to use in color theme plist generating”""
el = {
‘name’: escape(color.hex),
‘scope’: color.hex,
‘settings’: {
‘background’: color.hex,
‘foreground’: color.opposite
}
}
return el
def colorize_regions(view, regions, colors):
“”"Colorize given regions
through ST API.
Arguments:
regions: [sublime.Region], regions to colorize
colors: , colors to colorize `regions`
"""
regions_colors = zip(regions, colors)
for r, c in regions_colors:
view.add_regions(str(r), [r], c.hex)[/code]
I haven’t dug into how you are trying to manage re-colorization, but that is going to have to be looked into. I think at one time in testing, I had a rgb color highlighted in three overlapping colors.
**Edit: **I think I will make a pull request of the few things I have changed. I fix the RGB issue, I fixed the handling of your 3 sign hex. I might not get to it today, but I will let you know.