atelier-dune-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} Dune Light`,
 9        ...metaCommon,
10        url: "https://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune/",
11    },
12    colors: {
13        base00: "#fefbec",
14        base01: "#e8e4cf",
15        base02: "#a6a28c",
16        base03: "#999580",
17        base04: "#7d7a68",
18        base05: "#6e6b5e",
19        base06: "#292824",
20        base07: "#20201d",
21        base08: "#d73737",
22        base09: "#b65611",
23        base0A: "#ae9513",
24        base0B: "#60ac39",
25        base0C: "#1fad83",
26        base0D: "#6684e1",
27        base0E: "#b854d4",
28        base0F: "#d43552",
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