Skip to content

Commit

Permalink
add dracula-soft theme variant. #30
Browse files Browse the repository at this point in the history
  • Loading branch information
dsifford committed May 10, 2017
1 parent acec607 commit d191b01
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -2,4 +2,4 @@ root = true

[*.yml]
indent_style = space
indent_size = 2
indent_size = 2
8 changes: 8 additions & 0 deletions 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
Expand Down
14 changes: 11 additions & 3 deletions 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));
8 changes: 7 additions & 1 deletion package.json
Expand Up @@ -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"
}
}
4 changes: 4 additions & 0 deletions yarn.lock
Expand Up @@ -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"

0 comments on commit d191b01

Please sign in to comment.