forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {type MaterialYouPalette} from '@assembless/react-native-material-you'
2import {createThemes} from '@bsky.app/alf'
3
4import {type Palette, STATIC_VALUES} from '../themes'
5import {getMaterialYouColor} from './materialYou'
6
7export function getMaterial3Colors(palette: MaterialYouPalette) {
8 const MATERIAL_3_PALETTE: Palette = {
9 white: getMaterialYouColor(palette, 'system_neutral1', 0),
10 black: getMaterialYouColor(palette, 'system_neutral1', 1000),
11 pink: getMaterialYouColor(palette, 'system_accent3', 500),
12 yellow: getMaterialYouColor(
13 palette,
14 'system_error',
15 200,
16 STATIC_VALUES.yellow,
17 ),
18 like: getMaterialYouColor(palette, 'system_accent3', 500),
19
20 contrast_0: getMaterialYouColor(palette, 'system_neutral1', 0),
21 contrast_25: getMaterialYouColor(palette, 'system_neutral1', 10),
22 contrast_50: getMaterialYouColor(palette, 'system_neutral1', 50),
23 contrast_100: getMaterialYouColor(palette, 'system_neutral1', 100),
24 contrast_200: getMaterialYouColor(palette, 'system_neutral1', 200),
25 contrast_300: getMaterialYouColor(palette, 'system_neutral1', 300),
26 contrast_400: getMaterialYouColor(palette, 'system_neutral1', 400),
27 contrast_500: getMaterialYouColor(palette, 'system_neutral1', 500),
28 contrast_600: getMaterialYouColor(palette, 'system_neutral1', 600),
29 contrast_700: getMaterialYouColor(palette, 'system_neutral1', 700),
30 contrast_800: getMaterialYouColor(palette, 'system_neutral1', 800),
31 contrast_900: getMaterialYouColor(palette, 'system_neutral1', 900),
32 contrast_950: getMaterialYouColor(palette, 'system_neutral1', 900),
33 contrast_975: getMaterialYouColor(palette, 'system_neutral1', 900),
34 contrast_1000: getMaterialYouColor(palette, 'system_neutral1', 1000),
35
36 primary_25: getMaterialYouColor(palette, 'system_accent1', 10),
37 primary_50: getMaterialYouColor(palette, 'system_accent1', 50),
38 primary_100: getMaterialYouColor(palette, 'system_accent1', 100),
39 primary_200: getMaterialYouColor(palette, 'system_accent1', 200),
40 primary_300: getMaterialYouColor(palette, 'system_accent1', 300),
41 primary_400: getMaterialYouColor(palette, 'system_accent1', 400),
42 primary_500: getMaterialYouColor(palette, 'system_accent1', 500),
43 primary_600: getMaterialYouColor(palette, 'system_accent1', 600),
44 primary_700: getMaterialYouColor(palette, 'system_accent1', 700),
45 primary_800: getMaterialYouColor(palette, 'system_accent1', 800),
46 primary_900: getMaterialYouColor(palette, 'system_accent1', 900),
47 primary_950: getMaterialYouColor(palette, 'system_accent1', 900),
48 primary_975: getMaterialYouColor(palette, 'system_accent1', 1000),
49
50 positive_25: getMaterialYouColor(palette, 'system_accent2', 10),
51 positive_50: getMaterialYouColor(palette, 'system_accent2', 50),
52 positive_100: getMaterialYouColor(palette, 'system_accent2', 100),
53 positive_200: getMaterialYouColor(palette, 'system_accent2', 200),
54 positive_300: getMaterialYouColor(palette, 'system_accent2', 300),
55 positive_400: getMaterialYouColor(palette, 'system_accent2', 400),
56 positive_500: getMaterialYouColor(palette, 'system_accent2', 500),
57 positive_600: getMaterialYouColor(palette, 'system_accent2', 600),
58 positive_700: getMaterialYouColor(palette, 'system_accent2', 700),
59 positive_800: getMaterialYouColor(palette, 'system_accent2', 800),
60 positive_900: getMaterialYouColor(palette, 'system_accent2', 900),
61 positive_950: getMaterialYouColor(palette, 'system_accent2', 900),
62 positive_975: getMaterialYouColor(palette, 'system_accent2', 1000),
63
64 negative_25: getMaterialYouColor(palette, 'system_error', 10, '#FFF5F7'),
65 negative_50: getMaterialYouColor(palette, 'system_error', 50, '#FEEBEF'),
66 negative_100: getMaterialYouColor(palette, 'system_error', 100, '#FDD8E1'),
67 negative_200: getMaterialYouColor(palette, 'system_error', 200, '#FCC0CE'),
68 negative_300: getMaterialYouColor(palette, 'system_error', 300, '#F99AB0'),
69 negative_400: getMaterialYouColor(palette, 'system_error', 400, '#F76486'),
70 negative_500: getMaterialYouColor(palette, 'system_error', 500, '#EB2452'),
71 negative_600: getMaterialYouColor(palette, 'system_error', 600, '#D81341'),
72 negative_700: getMaterialYouColor(palette, 'system_error', 700, '#BA1239'),
73 negative_800: getMaterialYouColor(palette, 'system_error', 800, '#910D2C'),
74 negative_900: getMaterialYouColor(palette, 'system_error', 900, '#6F0B22'),
75 negative_950: getMaterialYouColor(palette, 'system_error', 900, '#500B1C'),
76 negative_975: getMaterialYouColor(palette, 'system_error', 1000, '#3E0915'),
77 }
78
79 const MATERIAL_3_SUBDUED_PALETTE: Palette = {
80 white: getMaterialYouColor(palette, 'system_neutral1', 50),
81 black: getMaterialYouColor(palette, 'system_neutral1', 900),
82 pink: getMaterialYouColor(palette, 'system_accent3', 500),
83 yellow: getMaterialYouColor(
84 palette,
85 'system_error',
86 200,
87 STATIC_VALUES.yellow,
88 ),
89 like: getMaterialYouColor(palette, 'system_accent3', 500),
90
91 contrast_0: getMaterialYouColor(palette, 'system_neutral1', 50),
92 contrast_25: getMaterialYouColor(palette, 'system_neutral1', 50),
93 contrast_50: getMaterialYouColor(palette, 'system_neutral1', 50),
94 contrast_100: getMaterialYouColor(palette, 'system_neutral1', 100),
95 contrast_200: getMaterialYouColor(palette, 'system_neutral1', 100),
96 contrast_300: getMaterialYouColor(palette, 'system_neutral1', 200),
97 contrast_400: getMaterialYouColor(palette, 'system_neutral1', 300),
98 contrast_500: getMaterialYouColor(palette, 'system_neutral1', 400),
99 contrast_600: getMaterialYouColor(palette, 'system_neutral1', 400),
100 contrast_700: getMaterialYouColor(palette, 'system_neutral1', 500),
101 contrast_800: getMaterialYouColor(palette, 'system_neutral1', 600),
102 contrast_900: getMaterialYouColor(palette, 'system_neutral1', 700),
103 contrast_950: getMaterialYouColor(palette, 'system_neutral1', 800),
104 contrast_975: getMaterialYouColor(palette, 'system_neutral1', 800),
105 contrast_1000: getMaterialYouColor(palette, 'system_neutral1', 900),
106
107 primary_25: getMaterialYouColor(palette, 'system_accent1', 10),
108 primary_50: getMaterialYouColor(palette, 'system_accent1', 50),
109 primary_100: getMaterialYouColor(palette, 'system_accent1', 100),
110 primary_200: getMaterialYouColor(palette, 'system_accent1', 200),
111 primary_300: getMaterialYouColor(palette, 'system_accent1', 300),
112 primary_400: getMaterialYouColor(palette, 'system_accent1', 400),
113 primary_500: getMaterialYouColor(palette, 'system_accent1', 400),
114 primary_600: getMaterialYouColor(palette, 'system_accent1', 500),
115 primary_700: getMaterialYouColor(palette, 'system_accent1', 600),
116 primary_800: getMaterialYouColor(palette, 'system_accent1', 700),
117 primary_900: getMaterialYouColor(palette, 'system_accent1', 800),
118 primary_950: getMaterialYouColor(palette, 'system_accent1', 800),
119 primary_975: getMaterialYouColor(palette, 'system_accent1', 900),
120
121 positive_25: getMaterialYouColor(palette, 'system_accent2', 10),
122 positive_50: getMaterialYouColor(palette, 'system_accent2', 50),
123 positive_100: getMaterialYouColor(palette, 'system_accent2', 100),
124 positive_200: getMaterialYouColor(palette, 'system_accent2', 200),
125 positive_300: getMaterialYouColor(palette, 'system_accent2', 300),
126 positive_400: getMaterialYouColor(palette, 'system_accent2', 400),
127 positive_500: getMaterialYouColor(palette, 'system_accent2', 400),
128 positive_600: getMaterialYouColor(palette, 'system_accent2', 500),
129 positive_700: getMaterialYouColor(palette, 'system_accent2', 600),
130 positive_800: getMaterialYouColor(palette, 'system_accent2', 700),
131 positive_900: getMaterialYouColor(palette, 'system_accent2', 800),
132 positive_950: getMaterialYouColor(palette, 'system_accent2', 900),
133 positive_975: getMaterialYouColor(palette, 'system_accent2', 900),
134
135 negative_25: getMaterialYouColor(palette, 'system_error', 10, '#FFF5F7'),
136 negative_50: getMaterialYouColor(palette, 'system_error', 50, '#FEEBEF'),
137 negative_100: getMaterialYouColor(palette, 'system_error', 100, '#FDD8E1'),
138 negative_200: getMaterialYouColor(palette, 'system_error', 200, '#FCC0CE'),
139 negative_300: getMaterialYouColor(palette, 'system_error', 300, '#F99AB0'),
140 negative_400: getMaterialYouColor(palette, 'system_error', 400, '#F76486'),
141 negative_500: getMaterialYouColor(palette, 'system_error', 400, '#EB2452'),
142 negative_600: getMaterialYouColor(palette, 'system_error', 500, '#D81341'),
143 negative_700: getMaterialYouColor(palette, 'system_error', 600, '#BA1239'),
144 negative_800: getMaterialYouColor(palette, 'system_error', 700, '#910D2C'),
145 negative_900: getMaterialYouColor(palette, 'system_error', 800, '#6F0B22'),
146 negative_950: getMaterialYouColor(palette, 'system_error', 800, '#500B1C'),
147 negative_975: getMaterialYouColor(palette, 'system_error', 900, '#3E0915'),
148 }
149
150 const MATERIAL_3_THEMES = createThemes({
151 defaultPalette: MATERIAL_3_PALETTE,
152 subduedPalette: MATERIAL_3_SUBDUED_PALETTE,
153 })
154
155 // special case for disabled (primary) button text. we have a hack for primary_subtle in Button.tsx
156 MATERIAL_3_THEMES.dark.atoms.text_inverted.color =
157 MATERIAL_3_THEMES.dark.palette.primary_400
158 MATERIAL_3_THEMES.dim.atoms.text_inverted.color =
159 MATERIAL_3_THEMES.dim.palette.primary_400
160
161 const material3scheme = {
162 lightPalette: MATERIAL_3_THEMES.light.palette,
163 darkPalette: MATERIAL_3_THEMES.dark.palette,
164 dimPalette: MATERIAL_3_THEMES.dim.palette,
165 light: MATERIAL_3_THEMES.light,
166 dark: MATERIAL_3_THEMES.dark,
167 dim: MATERIAL_3_THEMES.dim,
168 }
169
170 return {
171 regular: MATERIAL_3_PALETTE,
172 subdued: MATERIAL_3_SUBDUED_PALETTE,
173 scheme: material3scheme,
174 }
175}