From d191b01a2ac3afffa0685e2992868d5cbde8d0c8 Mon Sep 17 00:00:00 2001 From: Derek P Sifford Date: Wed, 10 May 2017 14:54:00 -0400 Subject: [PATCH] add dracula-soft theme variant. #30 --- .editorconfig | 2 +- CHANGELOG.md | 8 ++++++++ build.js | 14 +++++++++++--- package.json | 8 +++++++- yarn.lock | 4 ++++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 059fdd7..1e7d182 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,4 +2,4 @@ root = true [*.yml] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ffcb66..f2c8162 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 1.16.0 + +## Minor +- Add `Dracula Soft` theme variant (beta - comments/critiques welcomed). #30 + +## Patch +- Lighten ANSI `color0` and `color8` so that they're more legible in the terminal. #32 + # 1.15.1 ## Patch diff --git a/build.js b/build.js index 66f1131..929e710 100644 --- a/build.js +++ b/build.js @@ -1,4 +1,12 @@ -const yaml = require('js-yaml'); const fs = require('fs'); -const doc = yaml.safeLoad(fs.readFileSync(`${__dirname}/src/dracula.yml`, 'utf8')); -fs.writeFileSync(`${__dirname}/theme/dracula.json`, JSON.stringify(doc, null, 4)); +const tinycolor = require('tinycolor2'); +const yaml = require('js-yaml'); + +const standard = fs.readFileSync(`${__dirname}/src/dracula.yml`, 'utf8'); + +const soft = standard.replace(/'(#[0-9A-Z]{6})/g, (match, hex) => { + return `'${tinycolor(hex).brighten(8).desaturate(2).darken(5).toHexString()}`; +}); + +fs.writeFileSync(`${__dirname}/theme/dracula.json`, JSON.stringify(yaml.safeLoad(standard), null, 4)); +fs.writeFileSync(`${__dirname}/theme/dracula-soft.json`, JSON.stringify(yaml.safeLoad(soft), null, 4)); diff --git a/package.json b/package.json index e8e776d..ce76e75 100644 --- a/package.json +++ b/package.json @@ -42,10 +42,16 @@ "label": "Dracula", "uiTheme": "vs-dark", "path": "./theme/dracula.json" + }, + { + "label": "Dracula Soft", + "uiTheme": "vs-dark", + "path": "./theme/dracula-soft.json" } ] }, "devDependencies": { - "js-yaml": "^3.8.4" + "js-yaml": "^3.8.4", + "tinycolor2": "^1.4.1" } } diff --git a/yarn.lock b/yarn.lock index e82a95e..12becec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22,3 +22,7 @@ js-yaml@^3.8.4: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +tinycolor2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"