one-dark.ts

 1import chroma from "chroma-js"
 2import { Meta, ThemeSyntax } from "./common/colorScheme"
 3import { colorRamp, createColorScheme } from "./common/ramps"
 4
 5const name = "One Dark"
 6
 7const color = {
 8    white: "#ACB2BE",
 9    grey: "#5D636F",
10    red: "#D07277",
11    orange: "#C0966B",
12    yellow: "#DFC184",
13    green: "#A1C181",
14    teal: "#6FB4C0",
15    blue: "#74ADE9",
16    purple: "#B478CF",
17}
18
19const ramps = {
20    neutral: chroma
21        .scale([
22            "#282c34",
23            "#353b45",
24            "#3e4451",
25            "#545862",
26            "#565c64",
27            "#abb2bf",
28            "#b6bdca",
29            "#c8ccd4",
30        ])
31        .domain([0.05, 0.22, 0.25, 0.45, 0.62, 0.8, 0.9, 1]),
32    red: colorRamp(chroma(color.red)),
33    orange: colorRamp(chroma(color.orange)),
34    yellow: colorRamp(chroma(color.yellow)),
35    green: colorRamp(chroma(color.green)),
36    cyan: colorRamp(chroma(color.teal)),
37    blue: colorRamp(chroma(color.blue)),
38    violet: colorRamp(chroma(color.purple)),
39    magenta: colorRamp(chroma("#be5046")),
40}
41
42const syntax: ThemeSyntax = {
43    primary: { color: color.white },
44    comment: { color: color.grey },
45    function: { color: color.blue },
46    type: { color: color.teal },
47    property: { color: color.red },
48    number: { color: color.orange },
49    string: { color: color.green },
50    keyword: { color: color.purple },
51    boolean: { color: color.orange },
52    punctuation: { color: color.white },
53    operator: { color: color.teal },
54}
55
56export const dark = createColorScheme(name, false, ramps, syntax)
57
58export const meta: Meta = {
59    name,
60    author: "simurai",
61    license: {
62        SPDX: "MIT",
63        https_url:
64            "https://raw.githubusercontent.com/atom/atom/master/packages/one-light-ui/LICENSE.md",
65        license_checksum:
66            "d5af8fc171f6f600c0ab4e7597dca398dda80dbe6821ce01cef78e859e7a00f8",
67    },
68    url: "https://github.com/atom/atom/tree/master/packages/one-dark-ui",
69}