Permalink
Browse files

Init

  • Loading branch information...
0 parents commit 93b11446dd43da38e5c222fee1fe6027050ef642 @jxnblk committed Aug 14, 2016
Showing with 88 additions and 0 deletions.
  1. +16 −0 README.md
  2. +56 −0 index.js
  3. +16 −0 package.json
@@ -0,0 +1,16 @@
+
+# hypercolors
+
+Generative hyperterm color theme
+
+In `~/.hyperterm.js` add `hypercolors` to the plugins array.
+
+```js
+ plugins: [
+ 'hypercolors'
+ ]
+```
+
+Everytime hyperterm is opened, a randomly generated color scheme is created for that session. Force reloading will also update the colors.
+
+MIT License
@@ -0,0 +1,56 @@
+
+const chroma = require('chroma-js')
+const hello = require('hello-color').default
+
+const getBase = () => {
+ let base = chroma.random()
+ while (chroma(base).hsl()[1] > 1 / 3) {
+ base = chroma(base).desaturate(1 / 8).hex()
+ }
+ return base
+}
+
+exports.decorateConfig = config => {
+ const base = getBase()
+ const {
+ color,
+ scale,
+ hues
+ } = hello(base, {
+ hues: 5,
+ contrast: 5,
+ })
+
+ const foregroundColor = color
+ const backgroundColor = base
+ const borderColor = scale[1]
+
+ const colors = [
+ backgroundColor,
+ scale[7],
+ scale[7],
+ scale[7],
+ scale[6],
+ scale[5],
+ scale[5],
+ scale[5],
+ scale[6],
+ scale[7],
+ scale[7],
+ scale[6],
+ scale[5],
+ scale[5],
+ scale[5],
+ foregroundColor,
+ foregroundColor
+ ]
+
+ return Object.assign({}, config, {
+ foregroundColor,
+ backgroundColor,
+ borderColor,
+ colors,
+ termCSS: `${config.termCSS || ''} .cursor-node{mix-blend-mode:difference;}`
+ })
+}
+
@@ -0,0 +1,16 @@
+{
+ "name": "hypercolors",
+ "version": "1.0.0-beta.1",
+ "description": "Generative hyperterm color theme",
+ "main": "index.js",
+ "keywords": [
+ "hyperterm",
+ "hyperterm-theme"
+ ],
+ "author": "Brent Jackson",
+ "license": "MIT",
+ "dependencies": {
+ "chroma-js": "^1.2.1",
+ "hello-color": "^1.0.1"
+ }
+}

0 comments on commit 93b1144

Please sign in to comment.