one-dark.ts

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