diff --git a/CHANGELOG.md b/CHANGELOG.md index 23247b3..c705505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +#### 3.0.0 + +- Adds vivid and vivid italic themes! + - This change may require you to reselect the color theme in the `Editor` -> `Color Scheme` preferences. +- Update file colors to improve contrast + #### 2.12.1 - Fix JavaScript and TypeScript colors after the 2019.2 release @@ -37,51 +43,51 @@ #### 2.9.0 - Improves syntax highlighting for the following languages: - - Ruby - - ERB - - RDoc - - Slim - - Objective-C - - Swift + - Ruby + - ERB + - RDoc + - Slim + - Objective-C + - Swift #### 2.8.0 - Improves syntax highlighting for the following languages: - - C - - C++ - - Rust + - C + - C++ + - Rust - Improves syntax highlighting for Rider #### 2.7.0 - Update class reference to chalky - Improves syntax highlighting for the following languages: - - Go - - x86 assembly - - Python - - Django/Jinja2 Template - - Mako Template - - Jupyter - - Puppet - - GQL + - Go + - x86 assembly + - Python + - Django/Jinja2 Template + - Mako Template + - Jupyter + - Puppet + - GQL #### 2.6.0 - Update Java static final field color to whiskey - Update less and stylus variables to white - Improves syntax highlighting for the following languages: - - Dart - - Pug + - Dart + - Pug #### 2.5.0 - Update global constant color to whiskey - Improves syntax highlighting for the following languages: - - CoffeeScript - - Haml - - PHP - - Sass - - XPath + - CoffeeScript + - Haml + - PHP + - Sass + - XPath #### 2.4.1 @@ -96,10 +102,10 @@ - Update groovy unresolved reference color - Improves syntax highlighting for the following languages: - - Python - - Bash - - reStructuredText - - Buildout config + - Python + - Bash + - reStructuredText + - Buildout config #### 2.2.1 @@ -136,39 +142,39 @@ #### 1.7.1 - Improves syntax highlighting for the following languages: - - JSP - - Sass - - OSGi Manifest - - XPath - - Less + - JSP + - Sass + - OSGi Manifest + - XPath + - Less #### 1.6.0 - Improves syntax highlighting for the following languages: - - Markdown - - Properties - - Angular - - XML - - Database - - Regex + - Markdown + - Properties + - Angular + - XML + - Database + - Regex #### 1.5.0 - Improves syntax highlighting for the following languages: - - JavaScript - - TypeScript - - Kotlin - - CSS + - JavaScript + - TypeScript + - Kotlin + - CSS #### 1.4.1 - Improves syntax highlighting for the following languages: - - Groovy - - YAML - - EditorConfig - - Gerkin - - JSON - - HTML + - Groovy + - YAML + - EditorConfig + - Gerkin + - JSON + - HTML #### 1.3.6 diff --git a/scripts/build.py b/scripts/build.py index c8fc4ce..3e9eddd 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -20,8 +20,21 @@ FILE_NAME = 'one_dark' +def build_theme_name(color: str, italic: bool): + name = 'One Dark' + + if color != 'normal': + name += ' ' + color + + if italic: + name += ' italic' + + return name + + class Builder: - def __init__(self, italic: bool, filename: str): + def __init__(self, color: str, italic: bool, filename: str): + self.color = color self.italic = italic self.filename = filename @@ -50,7 +63,7 @@ def get_color(self, color: str) -> str: return color def build_yaml(self) -> dict: - self.colors = self.read_yaml('colors') + self.colors = self.read_yaml(os.path.join('colors', self.color)) ide = self.read_yaml('ide') theme = self.read_yaml('theme') @@ -101,10 +114,7 @@ def transform(self, text: str) -> str: def build_xml(self) -> ElementTree: scheme = ET.Element('scheme') - scheme.attrib['name'] = '%s italic' % self.yaml['name'] \ - if self.italic \ - else self.yaml['name'] - + scheme.attrib['name'] = build_theme_name(self.color, self.italic) scheme.attrib['parent_scheme'] = self.yaml['parent-scheme'] scheme.attrib['version'] = '142' @@ -142,26 +152,38 @@ def write_file(self) -> None: self.xml.write(os.path.join(DEST_DIR, self.filename)) +def write_json(data: dict, output_path: str): + with open(os.path.join(DEST_DIR, output_path + '.theme.json'), 'w') as output_file: + json.dump(data, output_file) + + def build_json(): input_path = os.path.join(DEST_DIR, 'one_dark.theme.json') - output_path = os.path.join(DEST_DIR, 'one_dark_italic.theme.json') with open(input_path, 'r') as input_file: data = json.load(input_file, object_pairs_hook=OrderedDict) - data['name'] = 'One Dark italic' + data['name'] = build_theme_name('normal', True) data['editorScheme'] = '/themes/one_dark_italic.xml' + write_json(data, 'one_dark_italic') + + data['name'] = build_theme_name('vivid', False) + data['editorScheme'] = '/themes/one_dark_vivid.xml' + write_json(data, 'one_dark_vivid') - with open(output_path, 'w') as output_file: - json.dump(data, output_file, indent=2) + data['name'] = build_theme_name('vivid', True) + data['editorScheme'] = '/themes/one_dark_vivid_italic.xml' + write_json(data, 'one_dark_vivid_italic') def main(): if not os.path.exists(DEST_DIR): os.makedirs(DEST_DIR) - Builder(False, '%s.xml' % FILE_NAME).run() - Builder(True, '%s_italic.xml' % FILE_NAME).run() + Builder('normal', False, '%s.xml' % FILE_NAME).run() + Builder('normal', True, '%s_italic.xml' % FILE_NAME).run() + Builder('vivid', False, '%s_vivid.xml' % FILE_NAME).run() + Builder('vivid', True, '%s_vivid_italic.xml' % FILE_NAME).run() build_json() diff --git a/scripts/config/colors.yaml b/scripts/config/colors/normal.yaml similarity index 100% rename from scripts/config/colors.yaml rename to scripts/config/colors/normal.yaml diff --git a/scripts/config/colors/vivid.yaml b/scripts/config/colors/vivid.yaml new file mode 100644 index 0000000..2ec3169 --- /dev/null +++ b/scripts/config/colors/vivid.yaml @@ -0,0 +1,12 @@ +%YAML 1.2 +--- +chalky: e5c07b +coral: ef596f +dark: 5c6370 +error: f44747 +fountainBlue: 2bbac5 +green: 89ca78 +lightWhite: bbbbbb +malibu: 61afef +purple: d55fde +whiskey: d19a66 diff --git a/scripts/config/theme.yaml b/scripts/config/theme.yaml index 7f86397..f698556 100644 --- a/scripts/config/theme.yaml +++ b/scripts/config/theme.yaml @@ -1,6 +1,5 @@ %YAML 1.2 --- -name: One dark parent-scheme: Darcula colors: ADDED_LINES_COLOR: green diff --git a/scripts/test/test_files.py b/scripts/test/test_files.py index 498de10..5c8c2f3 100644 --- a/scripts/test/test_files.py +++ b/scripts/test/test_files.py @@ -14,11 +14,18 @@ def file_exists(file_path): return os.path.exists(full_path) and os.path.isfile(full_path) def test_theme_files(self): + # Normal self.assertTrue(self.file_exists(THEME_DIR + '/one_dark.theme.json')) self.assertTrue(self.file_exists(THEME_DIR + '/one_dark.xml')) self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_italic.theme.json')) self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_italic.xml')) + # Vivid + self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_vivid.theme.json')) + self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_vivid.xml')) + self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_vivid_italic.theme.json')) + self.assertTrue(self.file_exists(THEME_DIR + '/one_dark_vivid_italic.xml')) + def test_meta_files(self): self.assertTrue(self.file_exists(META_DIR + '/plugin.xml')) self.assertTrue(self.file_exists(META_DIR + '/pluginIcon.svg')) diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 5e774a4..28162c0 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,6 @@ com.markskelton.one-dark-theme One Dark theme - UI Mark Skelton @@ -10,5 +9,7 @@ + + diff --git a/src/main/resources/themes/one_dark.theme.json b/src/main/resources/themes/one_dark.theme.json index d00f000..b714b3d 100644 --- a/src/main/resources/themes/one_dark.theme.json +++ b/src/main/resources/themes/one_dark.theme.json @@ -119,12 +119,12 @@ }, "FileColor": { - "Yellow": "#563b22cc", - "Green": "#334e1fcc", - "Blue": "#1e264bcc", - "Violet": "#4b1e4bcc", - "Orange": "#562b22cc", - "Rose": "#50202bcc" + "Yellow": "#563b2255", + "Green": "#334e1f55", + "Blue": "#28436d55", + "Violet": "#37115655", + "Orange": "#562b2255", + "Rose": "#561a2b55" }, "Link": {