atelier-cave-light.ts

 1import chroma from "chroma-js"
 2import { Meta } from "./common/colorScheme"
 3import { colorRamp, createColorScheme } from "./common/ramps"
 4import { metaCommon, name, buildSyntax, Variant } from "./common/atelier-common"
 5
 6const variant: Variant = {
 7    meta: {
 8        name: `${name} Cave Light`,
 9        ...metaCommon,
10        url: "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave/",
11    },
12    colors: {
13        base00: "#efecf4",
14        base01: "#e2dfe7",
15        base02: "#8b8792",
16        base03: "#7e7887",
17        base04: "#655f6d",
18        base05: "#585260",
19        base06: "#26232a",
20        base07: "#19171c",
21        base08: "#be4678",
22        base09: "#aa573c",
23        base0A: "#a06e3b",
24        base0B: "#2a9292",
25        base0C: "#398bc6",
26        base0D: "#576ddb",
27        base0E: "#955ae7",
28        base0F: "#bf40bf",
29    },
30}
31
32const syntax = buildSyntax(variant)
33
34const theme = (variant: Variant) => {
35    const { meta, colors } = variant
36
37    return createColorScheme(
38        meta.name,
39        true,
40        {
41            neutral: chroma.scale(
42                [
43                    colors.base00,
44                    colors.base01,
45                    colors.base02,
46                    colors.base03,
47                    colors.base04,
48                    colors.base05,
49                    colors.base06,
50                    colors.base07,
51                ].reverse()
52            ),
53            red: colorRamp(chroma(colors.base08)),
54            orange: colorRamp(chroma(colors.base09)),
55            yellow: colorRamp(chroma(colors.base0A)),
56            green: colorRamp(chroma(colors.base0B)),
57            cyan: colorRamp(chroma(colors.base0C)),
58            blue: colorRamp(chroma(colors.base0D)),
59            violet: colorRamp(chroma(colors.base0E)),
60            magenta: colorRamp(chroma(colors.base0F)),
61        },
62        syntax
63    )
64}
65
66export const dark = theme(variant)
67
68export const meta: Meta = variant.meta