-
Notifications
You must be signed in to change notification settings - Fork 0
/
palettes.ts
110 lines (102 loc) · 2.75 KB
/
palettes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// @deno-types="npm:@types/chroma-js@2"
import Chroma, { type Color } from "chroma";
const { oklch } = Chroma;
import type { Theme as LeonardoTheme } from "@adobe/leonardo-contrast-colors";
import { Shade } from "./generate.ts";
export type KeyColors<T> = {
/** Base background color */
base: T;
red: T;
orange: T;
green: T;
blue: T;
teal: T;
purple: T;
};
export type CustomColors<T> = {
primary: T;
secondary: T;
};
export type BackgroundColors<T> = {
background: T;
surface: T;
overlay: T;
};
export type Polarity = "dark" | "light";
export type Theme = {
name: string;
theme: LeonardoTheme;
polarity: Polarity;
backgrounds: BackgroundColors<Chroma.Color>;
baseShade: Shade;
brightShade: Shade;
};
/** base16 colors. Used for syntax highlighting and for porting to other apps */
export type Base24<T> = {
/** Default background */
base00: T;
/** Lighter background (used for status bars) */
base01: T;
/** Selection background */
base02: T;
/** Comments, Invisibles, Line Highlighting */
base03: T;
/** Dark foreground */
base04: T;
/** Light foreground */
base05: T;
/** Lighter foreground. White */
base06: T;
/** Lightest foreground. Bright white */
base07: T;
/** Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted. Red */
base08: T;
/** Integers, Boolean, Constants, XML Attributes, Markup Link Url. Yellow */
base09: T;
/** Classes, Markup Bold, Search Text Background. Bright yellow */
base0A: T;
/** Strings, Inherited Class, Markup Code, Diff Inserted Green */
base0B: T;
/** Support, Regular Expressions, Escape Characters, Markup Quotes. Cyan */
base0C: T;
/** Functions, Methods, Attribute IDs, Headings. Blue */
base0D: T;
/** Keywords, Storage, Selector, Markup Italic, Diff Changed. Purple */
base0E: T;
/** Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>. Dark brown/red */
base0F: T;
/** Darker background. Darker black */
base10: T;
/** Darkest background. Darkest black */
base11: T;
/** Bright red */
base12: T;
/** Bright yellow */
base13: T;
/** Bright green */
base14: T;
/** Bright cyan */
base15: T;
/** Bright blue */
base16: T;
/** Bright purple */
base17: T;
};
export const dark = {
base: oklch(0.16, 0.03, 284),
blue: oklch(0.77, 0.2, 240),
green: oklch(0.77, 0.2, 152),
orange: oklch(0.77, 0.2, 83),
purple: oklch(0.77, 0.2, 284),
red: oklch(0.62, 0.2, 27),
teal: oklch(0.77, 0.2, 190),
} satisfies KeyColors<Color>;
export const light = {
base: oklch(0.77, 0.02, 284),
blue: oklch(0.77, 0.2, 240),
green: oklch(0.77, 0.2, 152),
orange: oklch(0.77, 0.2, 83),
purple: oklch(0.77, 0.2, 284),
red: oklch(0.62, 0.2, 27),
teal: oklch(0.77, 0.2, 190),
} satisfies KeyColors<Color>;