solarized.ts

 1import chroma from "chroma-js";
 2import { colorRamp, createColorScheme } from "./common/ramps";
 3
 4const name = "Solarized";
 5const author = "Ethan Schoonover";
 6const url = "https://github.com/altercation/solarized";
 7const license = {
 8  type: "MIT",
 9  url: "https://github.com/altercation/solarized/blob/master/README.md",
10};
11
12const ramps = {
13  neutral: chroma
14    .scale([
15      "#002b36",
16      "#073642",
17      "#586e75",
18      "#657b83",
19      "#839496",
20      "#93a1a1",
21      "#eee8d5",
22      "#fdf6e3",
23    ])
24    .domain([0, 0.2, 0.38, 0.45, 0.65, 0.7, 0.85, 1]),
25  red: colorRamp(chroma("#dc322f")),
26  orange: colorRamp(chroma("#cb4b16")),
27  yellow: colorRamp(chroma("#b58900")),
28  green: colorRamp(chroma("#859900")),
29  cyan: colorRamp(chroma("#2aa198")),
30  blue: colorRamp(chroma("#268bd2")),
31  violet: colorRamp(chroma("#6c71c4")),
32  magenta: colorRamp(chroma("#d33682")),
33};
34
35export const dark = createColorScheme(`${name} Dark`, false, ramps);
36export const light = createColorScheme(`${name} Light`, true, ramps);