From 01525b211e74a4a608499898af5e07fac4d27960 Mon Sep 17 00:00:00 2001 From: mechatroner Date: Wed, 20 Mar 2019 21:54:58 -0400 Subject: [PATCH] fix color scheme keys for #16 --- RainbowCSV.sublime-color-scheme | 20 ++++++++++---------- main.py | 25 ++++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/RainbowCSV.sublime-color-scheme b/RainbowCSV.sublime-color-scheme index 634362c..736a40d 100755 --- a/RainbowCSV.sublime-color-scheme +++ b/RainbowCSV.sublime-color-scheme @@ -5,18 +5,18 @@ "caret": "#F8F8F0", "foreground": "#F8F8F2", "invisibles": "#3B3A32", - "lineHighlight": "#3E3D32", + "line_highlight": "#3E3D32", "selection": "#49483E", - "findHighlight": "#FFE792", - "findHighlightForeground": "#000000", - "selectionBorder": "#222218", - "activeGuide": "#9D550FB0", + "find_highlight": "#FFE792", + "find_highlight_foreground": "#000000", + "selection_border": "#222218", + "active_guide": "#9D550FB0", "misspelling": "#F92672", - "bracketsForeground": "#F8F8F2A5", - "bracketsOptions": "underline", - "bracketContentsForeground": "#F8F8F2A5", - "bracketContentsOptions": "underline", - "tagsOptions": "stippled_underline" + "brackets_foreground": "#F8F8F2A5", + "brackets_options": "underline", + "bracket_contents_foreground": "#F8F8F2A5", + "bracket_contents_options": "underline", + "tags_options": "stippled_underline" }, "rules": [ diff --git a/main.py b/main.py index dce70b3..1f201fd 100644 --- a/main.py +++ b/main.py @@ -86,24 +86,24 @@ def do_adjust_color_scheme(style): rgb_value = hex_to_rgb(background_color) is_dark_theme = rgb_value[0] + rgb_value[1] + rgb_value[2] < 128 * 3 - color_scheme['globals']["bracketContentsOptions"] = "underline" - color_scheme['globals']["tagsOptions"] = "stippled_underline" + color_scheme['globals']["bracket_contents_options"] = "underline" + color_scheme['globals']["tags_options"] = "stippled_underline" color_keys = [ 'background', 'caret', 'foreground', 'invisibles', - 'lineHighlight', + 'line_highlight', 'selection', - 'findHighlight', - 'findHighlightForeground', - 'selectionBorder', - 'activeGuide', + 'find_highlight', + 'find_highlight_foreground', + 'selection_border', + 'active_guide', 'misspelling', - 'bracketsForeground', - 'bracketsOptions', - 'bracketContentsForeground' + 'brackets_foreground', + 'brackets_options', + 'bracket_contents_foreground' ] rainbow_colors_dark = [ @@ -136,9 +136,8 @@ def do_adjust_color_scheme(style): rainbow_colors = rainbow_colors_dark if is_dark_theme else rainbow_colors_light for key in color_keys: - normalized_key = re.sub(r'([A-Z])', r'_\1', key).lower() - if normalized_key in style: - color_scheme['globals'][key] = style[normalized_key] + if key in style: + color_scheme['globals'][key] = style[key] for i, scope_name in enumerate(rainbow_scope_names): color_scheme['rules'].append({'name': 'rainbow csv rainbow{}'.format(i + 1), 'scope': scope_name, 'foreground': rainbow_colors[i]})