1use gpui::*;
2use std::time::Duration;
3
4use crate::capabilities::foundation::fonts::{UI_FONT_FAMILY, UI_MONO_FONT_FAMILY};
5
6#[derive(Clone, Debug)]
8pub struct ThemeTokens {
9 pub background: Hsla,
10 pub foreground: Hsla,
11 pub card: Hsla,
12 pub card_foreground: Hsla,
13 pub popover: Hsla,
14 pub popover_foreground: Hsla,
15 pub muted: Hsla,
16 pub muted_foreground: Hsla,
17 pub accent: Hsla,
18 pub accent_foreground: Hsla,
19 pub primary: Hsla,
20 pub primary_foreground: Hsla,
21 pub secondary: Hsla,
22 pub secondary_foreground: Hsla,
23 pub destructive: Hsla,
24 pub destructive_foreground: Hsla,
25 pub border: Hsla,
26 pub input: Hsla,
27 pub ring: Hsla,
28
29 pub radius_sm: Pixels,
30 pub radius_md: Pixels,
31 pub radius_lg: Pixels,
32 pub radius_xl: Pixels,
33
34 pub shadow_xs: BoxShadow,
35 pub shadow_sm: BoxShadow,
36 pub shadow_md: BoxShadow,
37 pub shadow_lg: BoxShadow,
38 pub shadow_xl: BoxShadow,
39
40 pub ring_offset: Pixels,
41
42 pub transition_fast: Duration,
43 pub transition_base: Duration,
44 pub transition_slow: Duration,
45
46 pub font_family: SharedString,
47 pub font_mono: SharedString,
48
49 pub spacing_1: Pixels,
50 pub spacing_2: Pixels,
51 pub spacing_3: Pixels,
52 pub spacing_4: Pixels,
53 pub spacing_5: Pixels,
54 pub spacing_6: Pixels,
55 pub spacing_8: Pixels,
56 pub spacing_10: Pixels,
57 pub spacing_12: Pixels,
58 pub spacing_16: Pixels,
59
60 pub duration_fastest: Duration,
61 pub duration_faster: Duration,
62 pub duration_fast: Duration,
63 pub duration_normal: Duration,
64 pub duration_slow: Duration,
65 pub duration_slower: Duration,
66 pub duration_slowest: Duration,
67
68 pub z_dropdown: u32,
69 pub z_sticky: u32,
70 pub z_modal: u32,
71 pub z_popover: u32,
72 pub z_tooltip: u32,
73}
74
75impl ThemeTokens {
76 fn standard_spacing_duration_z() -> (
77 Pixels,
78 Pixels,
79 Pixels,
80 Pixels,
81 Pixels,
82 Pixels,
83 Pixels,
84 Pixels,
85 Pixels,
86 Pixels,
87 Duration,
88 Duration,
89 Duration,
90 Duration,
91 Duration,
92 Duration,
93 Duration,
94 u32,
95 u32,
96 u32,
97 u32,
98 u32,
99 ) {
100 (
101 px(4.0),
102 px(8.0),
103 px(12.0),
104 px(16.0),
105 px(20.0),
106 px(24.0),
107 px(32.0),
108 px(40.0),
109 px(48.0),
110 px(64.0),
111 Duration::from_millis(50),
112 Duration::from_millis(100),
113 Duration::from_millis(150),
114 Duration::from_millis(200),
115 Duration::from_millis(300),
116 Duration::from_millis(400),
117 Duration::from_millis(500),
118 1000,
120 900,
122 1300,
123 1400,
124 1500,
125 )
126 }
127
128 fn apply_standard(mut self) -> Self {
129 let (
130 s1,
131 s2,
132 s3,
133 s4,
134 s5,
135 s6,
136 s8,
137 s10,
138 s12,
139 s16,
140 df,
141 dfr,
142 dfa,
143 dn,
144 ds,
145 dsr,
146 dst,
147 zd,
148 zs,
149 zm,
150 zp,
151 zt,
152 ) = Self::standard_spacing_duration_z();
153 self.spacing_1 = s1;
154 self.spacing_2 = s2;
155 self.spacing_3 = s3;
156 self.spacing_4 = s4;
157 self.spacing_5 = s5;
158 self.spacing_6 = s6;
159 self.spacing_8 = s8;
160 self.spacing_10 = s10;
161 self.spacing_12 = s12;
162 self.spacing_16 = s16;
163 self.duration_fastest = df;
164 self.duration_faster = dfr;
165 self.duration_fast = dfa;
166 self.duration_normal = dn;
167 self.duration_slow = ds;
168 self.duration_slower = dsr;
169 self.duration_slowest = dst;
170 self.z_dropdown = zd;
171 self.z_sticky = zs;
172 self.z_modal = zm;
173 self.z_popover = zp;
174 self.z_tooltip = zt;
175 self
176 }
177
178 pub fn light() -> Self {
179 Self {
180 background: rgb(0xffffff).into(),
181 foreground: rgb(0x0a0a0a).into(),
182 card: rgb(0xffffff).into(),
183 card_foreground: rgb(0x0a0a0a).into(),
184 popover: rgb(0xffffff).into(),
185 popover_foreground: rgb(0x0a0a0a).into(),
186 muted: rgb(0xf5f5f5).into(),
187 muted_foreground: rgb(0x737373).into(),
188 accent: rgb(0xf5f5f5).into(),
189 accent_foreground: rgb(0x0a0a0a).into(),
190 primary: rgb(0x000000).into(),
191 primary_foreground: rgb(0xffffff).into(),
192 secondary: rgb(0xf5f5f5).into(),
193 secondary_foreground: rgb(0x0a0a0a).into(),
194 destructive: rgb(0xef4444).into(),
195 destructive_foreground: rgb(0xffffff).into(),
196 border: rgb(0xe5e5e5).into(),
197 input: rgb(0xe5e5e5).into(),
198 ring: rgb(0xd4d4d8).into(),
199
200 radius_sm: px(4.0),
201 radius_md: px(6.0),
202 radius_lg: px(8.0),
203 radius_xl: px(12.0),
204
205 shadow_xs: BoxShadow {
206 offset: point(px(0.0), px(1.0)),
207 blur_radius: px(2.0),
208 spread_radius: px(0.0),
209 inset: false,
210 color: hsla(0.0, 0.0, 0.0, 0.05),
211 },
212 shadow_sm: BoxShadow {
213 offset: point(px(0.0), px(1.0)),
214 blur_radius: px(3.0),
215 spread_radius: px(0.0),
216 inset: false,
217 color: hsla(0.0, 0.0, 0.0, 0.1),
218 },
219 shadow_md: BoxShadow {
220 offset: point(px(0.0), px(4.0)),
221 blur_radius: px(6.0),
222 spread_radius: px(-1.0),
223 inset: false,
224 color: hsla(0.0, 0.0, 0.0, 0.1),
225 },
226 shadow_lg: BoxShadow {
227 offset: point(px(0.0), px(10.0)),
228 blur_radius: px(15.0),
229 spread_radius: px(-3.0),
230 inset: false,
231 color: hsla(0.0, 0.0, 0.0, 0.1),
232 },
233 shadow_xl: BoxShadow {
234 offset: point(px(0.0), px(20.0)),
235 blur_radius: px(25.0),
236 spread_radius: px(-5.0),
237 inset: false,
238 color: hsla(0.0, 0.0, 0.0, 0.1),
239 },
240
241 ring_offset: px(2.0),
242
243 transition_fast: Duration::from_millis(150),
244 transition_base: Duration::from_millis(200),
245 transition_slow: Duration::from_millis(300),
246
247 font_family: UI_FONT_FAMILY.into(),
248 font_mono: UI_MONO_FONT_FAMILY.into(),
249
250 spacing_1: px(0.0),
251 spacing_2: px(0.0),
252 spacing_3: px(0.0),
253 spacing_4: px(0.0),
254 spacing_5: px(0.0),
255 spacing_6: px(0.0),
256 spacing_8: px(0.0),
257 spacing_10: px(0.0),
258 spacing_12: px(0.0),
259 spacing_16: px(0.0),
260 duration_fastest: Duration::ZERO,
261 duration_faster: Duration::ZERO,
262 duration_fast: Duration::ZERO,
263 duration_normal: Duration::ZERO,
264 duration_slow: Duration::ZERO,
265 duration_slower: Duration::ZERO,
266 duration_slowest: Duration::ZERO,
267 z_dropdown: 0,
268 z_sticky: 0,
269 z_modal: 0,
270 z_popover: 0,
271 z_tooltip: 0,
272 }
273 .apply_standard()
274 }
275
276 pub fn dark() -> Self {
277 Self {
278 background: rgb(0x000000).into(),
279 foreground: rgb(0xf5f5f5).into(),
280 card: rgb(0x0a0a0a).into(),
281 card_foreground: rgb(0xf5f5f5).into(),
282 popover: rgb(0x0a0a0a).into(),
283 popover_foreground: rgb(0xf5f5f5).into(),
284 muted: rgb(0x1a1a1a).into(),
285 muted_foreground: rgb(0x737373).into(),
286 accent: rgb(0x262626).into(),
287 accent_foreground: rgb(0xffffff).into(),
288 primary: rgb(0xffffff).into(),
289 primary_foreground: rgb(0x000000).into(),
290 secondary: rgb(0x262626).into(),
291 secondary_foreground: rgb(0xf5f5f5).into(),
292 destructive: rgb(0xff4444).into(),
293 destructive_foreground: rgb(0xffffff).into(),
294 border: rgb(0x333333).into(),
295 input: rgb(0x333333).into(),
296 ring: rgb(0xffffff).into(),
297
298 radius_sm: px(4.0),
299 radius_md: px(6.0),
300 radius_lg: px(8.0),
301 radius_xl: px(12.0),
302
303 shadow_xs: BoxShadow {
304 offset: point(px(0.0), px(1.0)),
305 blur_radius: px(2.0),
306 spread_radius: px(0.0),
307 inset: false,
308 color: hsla(0.0, 0.0, 0.0, 0.5),
309 },
310 shadow_sm: BoxShadow {
311 offset: point(px(0.0), px(1.0)),
312 blur_radius: px(3.0),
313 spread_radius: px(0.0),
314 inset: false,
315 color: hsla(0.0, 0.0, 0.0, 0.6),
316 },
317 shadow_md: BoxShadow {
318 offset: point(px(0.0), px(4.0)),
319 blur_radius: px(6.0),
320 spread_radius: px(-1.0),
321 inset: false,
322 color: hsla(0.0, 0.0, 0.0, 0.7),
323 },
324 shadow_lg: BoxShadow {
325 offset: point(px(0.0), px(10.0)),
326 blur_radius: px(15.0),
327 spread_radius: px(-3.0),
328 inset: false,
329 color: hsla(0.0, 0.0, 0.0, 0.8),
330 },
331 shadow_xl: BoxShadow {
332 offset: point(px(0.0), px(20.0)),
333 blur_radius: px(25.0),
334 spread_radius: px(-5.0),
335 inset: false,
336 color: hsla(0.0, 0.0, 0.0, 0.9),
337 },
338
339 ring_offset: px(2.0),
340
341 transition_fast: Duration::from_millis(150),
342 transition_base: Duration::from_millis(200),
343 transition_slow: Duration::from_millis(300),
344
345 font_family: UI_FONT_FAMILY.into(),
346 font_mono: UI_MONO_FONT_FAMILY.into(),
347
348 spacing_1: px(0.0),
349 spacing_2: px(0.0),
350 spacing_3: px(0.0),
351 spacing_4: px(0.0),
352 spacing_5: px(0.0),
353 spacing_6: px(0.0),
354 spacing_8: px(0.0),
355 spacing_10: px(0.0),
356 spacing_12: px(0.0),
357 spacing_16: px(0.0),
358 duration_fastest: Duration::ZERO,
359 duration_faster: Duration::ZERO,
360 duration_fast: Duration::ZERO,
361 duration_normal: Duration::ZERO,
362 duration_slow: Duration::ZERO,
363 duration_slower: Duration::ZERO,
364 duration_slowest: Duration::ZERO,
365 z_dropdown: 0,
366 z_sticky: 0,
367 z_modal: 0,
368 z_popover: 0,
369 z_tooltip: 0,
370 }
371 .apply_standard()
372 }
373
374 pub fn midnight_blue() -> Self {
375 Self {
376 background: rgb(0x0a0f14).into(), foreground: rgb(0xe6edf3).into(),
378 card: rgb(0x0f1419).into(),
379 card_foreground: rgb(0xe6edf3).into(),
380 popover: rgb(0x0f1419).into(),
381 popover_foreground: rgb(0xe6edf3).into(),
382 muted: rgb(0x161b22).into(),
383 muted_foreground: rgb(0x6e7681).into(),
384 accent: rgb(0x1e3a8a).into(),
385 accent_foreground: rgb(0x60a5fa).into(),
386 primary: rgb(0x60a5fa).into(), primary_foreground: rgb(0x0a0f14).into(),
388 secondary: rgb(0x1e293b).into(),
389 secondary_foreground: rgb(0xe2e8f0).into(),
390 destructive: rgb(0xef4444).into(),
391 destructive_foreground: rgb(0xffffff).into(),
392 border: rgb(0x21262d).into(),
393 input: rgb(0x21262d).into(),
394 ring: rgb(0x60a5fa).into(),
395
396 radius_sm: px(4.0),
397 radius_md: px(6.0),
398 radius_lg: px(8.0),
399 radius_xl: px(12.0),
400
401 shadow_xs: BoxShadow {
402 offset: point(px(0.0), px(1.0)),
403 blur_radius: px(2.0),
404 spread_radius: px(0.0),
405 inset: false,
406 color: hsla(0.0, 0.0, 0.0, 0.15),
407 },
408 shadow_sm: BoxShadow {
409 offset: point(px(0.0), px(1.0)),
410 blur_radius: px(3.0),
411 spread_radius: px(0.0),
412 inset: false,
413 color: hsla(0.0, 0.0, 0.0, 0.2),
414 },
415 shadow_md: BoxShadow {
416 offset: point(px(0.0), px(4.0)),
417 blur_radius: px(6.0),
418 spread_radius: px(-1.0),
419 inset: false,
420 color: hsla(0.0, 0.0, 0.0, 0.15),
421 },
422 shadow_lg: BoxShadow {
423 offset: point(px(0.0), px(10.0)),
424 blur_radius: px(15.0),
425 spread_radius: px(-3.0),
426 inset: false,
427 color: hsla(0.0, 0.0, 0.0, 0.15),
428 },
429 shadow_xl: BoxShadow {
430 offset: point(px(0.0), px(20.0)),
431 blur_radius: px(25.0),
432 spread_radius: px(-5.0),
433 inset: false,
434 color: hsla(0.0, 0.0, 0.0, 0.15),
435 },
436
437 ring_offset: px(2.0),
438
439 transition_fast: Duration::from_millis(150),
440 transition_base: Duration::from_millis(200),
441 transition_slow: Duration::from_millis(300),
442
443 font_family: UI_FONT_FAMILY.into(),
444 font_mono: UI_MONO_FONT_FAMILY.into(),
445
446 spacing_1: px(0.0),
447 spacing_2: px(0.0),
448 spacing_3: px(0.0),
449 spacing_4: px(0.0),
450 spacing_5: px(0.0),
451 spacing_6: px(0.0),
452 spacing_8: px(0.0),
453 spacing_10: px(0.0),
454 spacing_12: px(0.0),
455 spacing_16: px(0.0),
456 duration_fastest: Duration::ZERO,
457 duration_faster: Duration::ZERO,
458 duration_fast: Duration::ZERO,
459 duration_normal: Duration::ZERO,
460 duration_slow: Duration::ZERO,
461 duration_slower: Duration::ZERO,
462 duration_slowest: Duration::ZERO,
463 z_dropdown: 0,
464 z_sticky: 0,
465 z_modal: 0,
466 z_popover: 0,
467 z_tooltip: 0,
468 }
469 .apply_standard()
470 }
471
472 pub fn forest_grove() -> Self {
473 Self {
474 background: rgb(0x0a0e0b).into(), foreground: rgb(0xd4e5d4).into(),
476 card: rgb(0x0f1410).into(),
477 card_foreground: rgb(0xd4e5d4).into(),
478 popover: rgb(0x0f1410).into(),
479 popover_foreground: rgb(0xd4e5d4).into(),
480 muted: rgb(0x141a15).into(),
481 muted_foreground: rgb(0x6b7a6b).into(),
482 accent: rgb(0x14532d).into(),
483 accent_foreground: rgb(0x4ade80).into(),
484 primary: rgb(0x4ade80).into(), primary_foreground: rgb(0x0a0e0b).into(),
486 secondary: rgb(0x1e3a26).into(),
487 secondary_foreground: rgb(0xbbf7d0).into(),
488 destructive: rgb(0xf87171).into(),
489 destructive_foreground: rgb(0xffffff).into(),
490 border: rgb(0x1a2520).into(),
491 input: rgb(0x1a2520).into(),
492 ring: rgb(0x4ade80).into(),
493
494 radius_sm: px(4.0),
495 radius_md: px(6.0),
496 radius_lg: px(8.0),
497 radius_xl: px(12.0),
498
499 shadow_xs: BoxShadow {
500 offset: point(px(0.0), px(1.0)),
501 blur_radius: px(2.0),
502 spread_radius: px(0.0),
503 inset: false,
504 color: hsla(0.0, 0.0, 0.0, 0.15),
505 },
506 shadow_sm: BoxShadow {
507 offset: point(px(0.0), px(1.0)),
508 blur_radius: px(3.0),
509 spread_radius: px(0.0),
510 inset: false,
511 color: hsla(0.0, 0.0, 0.0, 0.2),
512 },
513 shadow_md: BoxShadow {
514 offset: point(px(0.0), px(4.0)),
515 blur_radius: px(6.0),
516 spread_radius: px(-1.0),
517 inset: false,
518 color: hsla(0.0, 0.0, 0.0, 0.15),
519 },
520 shadow_lg: BoxShadow {
521 offset: point(px(0.0), px(10.0)),
522 blur_radius: px(15.0),
523 spread_radius: px(-3.0),
524 inset: false,
525 color: hsla(0.0, 0.0, 0.0, 0.15),
526 },
527 shadow_xl: BoxShadow {
528 offset: point(px(0.0), px(20.0)),
529 blur_radius: px(25.0),
530 spread_radius: px(-5.0),
531 inset: false,
532 color: hsla(0.0, 0.0, 0.0, 0.15),
533 },
534
535 ring_offset: px(2.0),
536
537 transition_fast: Duration::from_millis(150),
538 transition_base: Duration::from_millis(200),
539 transition_slow: Duration::from_millis(300),
540
541 font_family: UI_FONT_FAMILY.into(),
542 font_mono: UI_MONO_FONT_FAMILY.into(),
543
544 spacing_1: px(0.0),
545 spacing_2: px(0.0),
546 spacing_3: px(0.0),
547 spacing_4: px(0.0),
548 spacing_5: px(0.0),
549 spacing_6: px(0.0),
550 spacing_8: px(0.0),
551 spacing_10: px(0.0),
552 spacing_12: px(0.0),
553 spacing_16: px(0.0),
554 duration_fastest: Duration::ZERO,
555 duration_faster: Duration::ZERO,
556 duration_fast: Duration::ZERO,
557 duration_normal: Duration::ZERO,
558 duration_slow: Duration::ZERO,
559 duration_slower: Duration::ZERO,
560 duration_slowest: Duration::ZERO,
561 z_dropdown: 0,
562 z_sticky: 0,
563 z_modal: 0,
564 z_popover: 0,
565 z_tooltip: 0,
566 }
567 .apply_standard()
568 }
569
570 pub fn sunset_amber() -> Self {
571 Self {
572 background: rgb(0x140a05).into(), foreground: rgb(0xfef3c7).into(),
574 card: rgb(0x1c0f08).into(),
575 card_foreground: rgb(0xfef3c7).into(),
576 popover: rgb(0x1c0f08).into(),
577 popover_foreground: rgb(0xfef3c7).into(),
578 muted: rgb(0x2a1810).into(),
579 muted_foreground: rgb(0x9d7c5a).into(),
580 accent: rgb(0x7c2d12).into(),
581 accent_foreground: rgb(0xfbbf24).into(),
582 primary: rgb(0xfbbf24).into(), primary_foreground: rgb(0x140a05).into(),
584 secondary: rgb(0x4c1d95).into(),
585 secondary_foreground: rgb(0xe9d5ff).into(),
586 destructive: rgb(0xef4444).into(),
587 destructive_foreground: rgb(0xffffff).into(),
588 border: rgb(0x3a2415).into(),
589 input: rgb(0x3a2415).into(),
590 ring: rgb(0xfbbf24).into(),
591
592 radius_sm: px(4.0),
593 radius_md: px(6.0),
594 radius_lg: px(8.0),
595 radius_xl: px(12.0),
596
597 shadow_xs: BoxShadow {
598 offset: point(px(0.0), px(1.0)),
599 blur_radius: px(2.0),
600 spread_radius: px(0.0),
601 inset: false,
602 color: hsla(0.0, 0.0, 0.0, 0.15),
603 },
604 shadow_sm: BoxShadow {
605 offset: point(px(0.0), px(1.0)),
606 blur_radius: px(3.0),
607 spread_radius: px(0.0),
608 inset: false,
609 color: hsla(0.0, 0.0, 0.0, 0.2),
610 },
611 shadow_md: BoxShadow {
612 offset: point(px(0.0), px(4.0)),
613 blur_radius: px(6.0),
614 spread_radius: px(-1.0),
615 inset: false,
616 color: hsla(0.0, 0.0, 0.0, 0.15),
617 },
618 shadow_lg: BoxShadow {
619 offset: point(px(0.0), px(10.0)),
620 blur_radius: px(15.0),
621 spread_radius: px(-3.0),
622 inset: false,
623 color: hsla(0.0, 0.0, 0.0, 0.15),
624 },
625 shadow_xl: BoxShadow {
626 offset: point(px(0.0), px(20.0)),
627 blur_radius: px(25.0),
628 spread_radius: px(-5.0),
629 inset: false,
630 color: hsla(0.0, 0.0, 0.0, 0.15),
631 },
632
633 ring_offset: px(2.0),
634
635 transition_fast: Duration::from_millis(150),
636 transition_base: Duration::from_millis(200),
637 transition_slow: Duration::from_millis(300),
638
639 font_family: UI_FONT_FAMILY.into(),
640 font_mono: UI_MONO_FONT_FAMILY.into(),
641
642 spacing_1: px(0.0),
643 spacing_2: px(0.0),
644 spacing_3: px(0.0),
645 spacing_4: px(0.0),
646 spacing_5: px(0.0),
647 spacing_6: px(0.0),
648 spacing_8: px(0.0),
649 spacing_10: px(0.0),
650 spacing_12: px(0.0),
651 spacing_16: px(0.0),
652 duration_fastest: Duration::ZERO,
653 duration_faster: Duration::ZERO,
654 duration_fast: Duration::ZERO,
655 duration_normal: Duration::ZERO,
656 duration_slow: Duration::ZERO,
657 duration_slower: Duration::ZERO,
658 duration_slowest: Duration::ZERO,
659 z_dropdown: 0,
660 z_sticky: 0,
661 z_modal: 0,
662 z_popover: 0,
663 z_tooltip: 0,
664 }
665 .apply_standard()
666 }
667
668 pub fn ocean_breeze() -> Self {
669 Self {
670 background: rgb(0x051018).into(), foreground: rgb(0xe3f2fd).into(),
672 card: rgb(0x0a1929).into(),
673 card_foreground: rgb(0xe3f2fd).into(),
674 popover: rgb(0x0a1929).into(),
675 popover_foreground: rgb(0xe3f2fd).into(),
676 muted: rgb(0x0f2638).into(),
677 muted_foreground: rgb(0x67a3b8).into(),
678 accent: rgb(0x0e7490).into(),
679 accent_foreground: rgb(0x22d3ee).into(),
680 primary: rgb(0x22d3ee).into(), primary_foreground: rgb(0x051018).into(),
682 secondary: rgb(0x0284c7).into(),
683 secondary_foreground: rgb(0xe0f2fe).into(),
684 destructive: rgb(0xf87171).into(),
685 destructive_foreground: rgb(0xffffff).into(),
686 border: rgb(0x0f2638).into(),
687 input: rgb(0x0f2638).into(),
688 ring: rgb(0x22d3ee).into(),
689
690 radius_sm: px(4.0),
691 radius_md: px(6.0),
692 radius_lg: px(8.0),
693 radius_xl: px(12.0),
694
695 shadow_xs: BoxShadow {
696 offset: point(px(0.0), px(1.0)),
697 blur_radius: px(2.0),
698 spread_radius: px(0.0),
699 inset: false,
700 color: hsla(0.0, 0.0, 0.0, 0.15),
701 },
702 shadow_sm: BoxShadow {
703 offset: point(px(0.0), px(1.0)),
704 blur_radius: px(3.0),
705 spread_radius: px(0.0),
706 inset: false,
707 color: hsla(0.0, 0.0, 0.0, 0.2),
708 },
709 shadow_md: BoxShadow {
710 offset: point(px(0.0), px(4.0)),
711 blur_radius: px(6.0),
712 spread_radius: px(-1.0),
713 inset: false,
714 color: hsla(0.0, 0.0, 0.0, 0.15),
715 },
716 shadow_lg: BoxShadow {
717 offset: point(px(0.0), px(10.0)),
718 blur_radius: px(15.0),
719 spread_radius: px(-3.0),
720 inset: false,
721 color: hsla(0.0, 0.0, 0.0, 0.15),
722 },
723 shadow_xl: BoxShadow {
724 offset: point(px(0.0), px(20.0)),
725 blur_radius: px(25.0),
726 spread_radius: px(-5.0),
727 inset: false,
728 color: hsla(0.0, 0.0, 0.0, 0.15),
729 },
730
731 ring_offset: px(2.0),
732
733 transition_fast: Duration::from_millis(150),
734 transition_base: Duration::from_millis(200),
735 transition_slow: Duration::from_millis(300),
736
737 font_family: UI_FONT_FAMILY.into(),
738 font_mono: UI_MONO_FONT_FAMILY.into(),
739
740 spacing_1: px(0.0),
741 spacing_2: px(0.0),
742 spacing_3: px(0.0),
743 spacing_4: px(0.0),
744 spacing_5: px(0.0),
745 spacing_6: px(0.0),
746 spacing_8: px(0.0),
747 spacing_10: px(0.0),
748 spacing_12: px(0.0),
749 spacing_16: px(0.0),
750 duration_fastest: Duration::ZERO,
751 duration_faster: Duration::ZERO,
752 duration_fast: Duration::ZERO,
753 duration_normal: Duration::ZERO,
754 duration_slow: Duration::ZERO,
755 duration_slower: Duration::ZERO,
756 duration_slowest: Duration::ZERO,
757 z_dropdown: 0,
758 z_sticky: 0,
759 z_modal: 0,
760 z_popover: 0,
761 z_tooltip: 0,
762 }
763 .apply_standard()
764 }
765
766 pub fn dracula() -> Self {
767 Self {
768 background: rgb(0x1e1f29).into(), foreground: rgb(0xf8f8f2).into(),
770 card: rgb(0x282a36).into(),
771 card_foreground: rgb(0xf8f8f2).into(),
772 popover: rgb(0x282a36).into(),
773 popover_foreground: rgb(0xf8f8f2).into(),
774 muted: rgb(0x44475a).into(),
775 muted_foreground: rgb(0x6272a4).into(),
776 accent: rgb(0x44475a).into(),
777 accent_foreground: rgb(0xf8f8f2).into(),
778 primary: rgb(0xc9a9ff).into(), primary_foreground: rgb(0x1e1f29).into(),
780 secondary: rgb(0x44475a).into(),
781 secondary_foreground: rgb(0xf8f8f2).into(),
782 destructive: rgb(0xff6e6e).into(),
783 destructive_foreground: rgb(0xf8f8f2).into(),
784 border: rgb(0x3a3c4e).into(),
785 input: rgb(0x3a3c4e).into(),
786 ring: rgb(0xc9a9ff).into(),
787
788 radius_sm: px(4.0),
789 radius_md: px(6.0),
790 radius_lg: px(8.0),
791 radius_xl: px(12.0),
792
793 shadow_xs: BoxShadow {
794 offset: point(px(0.0), px(1.0)),
795 blur_radius: px(2.0),
796 spread_radius: px(0.0),
797 inset: false,
798 color: hsla(0.0, 0.0, 0.0, 0.15),
799 },
800 shadow_sm: BoxShadow {
801 offset: point(px(0.0), px(1.0)),
802 blur_radius: px(3.0),
803 spread_radius: px(0.0),
804 inset: false,
805 color: hsla(0.0, 0.0, 0.0, 0.2),
806 },
807 shadow_md: BoxShadow {
808 offset: point(px(0.0), px(4.0)),
809 blur_radius: px(6.0),
810 spread_radius: px(-1.0),
811 inset: false,
812 color: hsla(0.0, 0.0, 0.0, 0.15),
813 },
814 shadow_lg: BoxShadow {
815 offset: point(px(0.0), px(10.0)),
816 blur_radius: px(15.0),
817 spread_radius: px(-3.0),
818 inset: false,
819 color: hsla(0.0, 0.0, 0.0, 0.15),
820 },
821 shadow_xl: BoxShadow {
822 offset: point(px(0.0), px(20.0)),
823 blur_radius: px(25.0),
824 spread_radius: px(-5.0),
825 inset: false,
826 color: hsla(0.0, 0.0, 0.0, 0.15),
827 },
828
829 ring_offset: px(2.0),
830
831 transition_fast: Duration::from_millis(150),
832 transition_base: Duration::from_millis(200),
833 transition_slow: Duration::from_millis(300),
834
835 font_family: UI_FONT_FAMILY.into(),
836 font_mono: UI_MONO_FONT_FAMILY.into(),
837
838 spacing_1: px(0.0),
839 spacing_2: px(0.0),
840 spacing_3: px(0.0),
841 spacing_4: px(0.0),
842 spacing_5: px(0.0),
843 spacing_6: px(0.0),
844 spacing_8: px(0.0),
845 spacing_10: px(0.0),
846 spacing_12: px(0.0),
847 spacing_16: px(0.0),
848 duration_fastest: Duration::ZERO,
849 duration_faster: Duration::ZERO,
850 duration_fast: Duration::ZERO,
851 duration_normal: Duration::ZERO,
852 duration_slow: Duration::ZERO,
853 duration_slower: Duration::ZERO,
854 duration_slowest: Duration::ZERO,
855 z_dropdown: 0,
856 z_sticky: 0,
857 z_modal: 0,
858 z_popover: 0,
859 z_tooltip: 0,
860 }
861 .apply_standard()
862 }
863
864 pub fn nord() -> Self {
865 Self {
866 background: rgb(0x242933).into(), foreground: rgb(0xeceff4).into(),
868 card: rgb(0x2e3440).into(),
869 card_foreground: rgb(0xeceff4).into(),
870 popover: rgb(0x2e3440).into(),
871 popover_foreground: rgb(0xeceff4).into(),
872 muted: rgb(0x3b4252).into(),
873 muted_foreground: rgb(0x81a1c1).into(),
874 accent: rgb(0x434c5e).into(),
875 accent_foreground: rgb(0x8fbcbb).into(),
876 primary: rgb(0x8fbcbb).into(), primary_foreground: rgb(0x242933).into(),
878 secondary: rgb(0x5e81ac).into(),
879 secondary_foreground: rgb(0xeceff4).into(),
880 destructive: rgb(0xbf616a).into(),
881 destructive_foreground: rgb(0xeceff4).into(),
882 border: rgb(0x3b4252).into(),
883 input: rgb(0x3b4252).into(),
884 ring: rgb(0x8fbcbb).into(),
885
886 radius_sm: px(4.0),
887 radius_md: px(6.0),
888 radius_lg: px(8.0),
889 radius_xl: px(12.0),
890
891 shadow_xs: BoxShadow {
892 offset: point(px(0.0), px(1.0)),
893 blur_radius: px(2.0),
894 spread_radius: px(0.0),
895 inset: false,
896 color: hsla(0.0, 0.0, 0.0, 0.15),
897 },
898 shadow_sm: BoxShadow {
899 offset: point(px(0.0), px(1.0)),
900 blur_radius: px(3.0),
901 spread_radius: px(0.0),
902 inset: false,
903 color: hsla(0.0, 0.0, 0.0, 0.2),
904 },
905 shadow_md: BoxShadow {
906 offset: point(px(0.0), px(4.0)),
907 blur_radius: px(6.0),
908 spread_radius: px(-1.0),
909 inset: false,
910 color: hsla(0.0, 0.0, 0.0, 0.15),
911 },
912 shadow_lg: BoxShadow {
913 offset: point(px(0.0), px(10.0)),
914 blur_radius: px(15.0),
915 spread_radius: px(-3.0),
916 inset: false,
917 color: hsla(0.0, 0.0, 0.0, 0.15),
918 },
919 shadow_xl: BoxShadow {
920 offset: point(px(0.0), px(20.0)),
921 blur_radius: px(25.0),
922 spread_radius: px(-5.0),
923 inset: false,
924 color: hsla(0.0, 0.0, 0.0, 0.15),
925 },
926
927 ring_offset: px(2.0),
928
929 transition_fast: Duration::from_millis(150),
930 transition_base: Duration::from_millis(200),
931 transition_slow: Duration::from_millis(300),
932
933 font_family: UI_FONT_FAMILY.into(),
934 font_mono: UI_MONO_FONT_FAMILY.into(),
935
936 spacing_1: px(0.0),
937 spacing_2: px(0.0),
938 spacing_3: px(0.0),
939 spacing_4: px(0.0),
940 spacing_5: px(0.0),
941 spacing_6: px(0.0),
942 spacing_8: px(0.0),
943 spacing_10: px(0.0),
944 spacing_12: px(0.0),
945 spacing_16: px(0.0),
946 duration_fastest: Duration::ZERO,
947 duration_faster: Duration::ZERO,
948 duration_fast: Duration::ZERO,
949 duration_normal: Duration::ZERO,
950 duration_slow: Duration::ZERO,
951 duration_slower: Duration::ZERO,
952 duration_slowest: Duration::ZERO,
953 z_dropdown: 0,
954 z_sticky: 0,
955 z_modal: 0,
956 z_popover: 0,
957 z_tooltip: 0,
958 }
959 .apply_standard()
960 }
961
962 pub fn monokai_pro() -> Self {
963 Self {
964 background: rgb(0x221f22).into(), foreground: rgb(0xfcfcfa).into(),
966 card: rgb(0x2d2a2e).into(),
967 card_foreground: rgb(0xfcfcfa).into(),
968 popover: rgb(0x2d2a2e).into(),
969 popover_foreground: rgb(0xfcfcfa).into(),
970 muted: rgb(0x403e41).into(),
971 muted_foreground: rgb(0x939293).into(),
972 accent: rgb(0x5b595c).into(),
973 accent_foreground: rgb(0xfcfcfa).into(),
974 primary: rgb(0xffe66d).into(), primary_foreground: rgb(0x221f22).into(),
976 secondary: rgb(0x5b595c).into(),
977 secondary_foreground: rgb(0xfcfcfa).into(),
978 destructive: rgb(0xff6e97).into(),
979 destructive_foreground: rgb(0xfcfcfa).into(),
980 border: rgb(0x403e41).into(),
981 input: rgb(0x403e41).into(),
982 ring: rgb(0xffe66d).into(),
983
984 radius_sm: px(4.0),
985 radius_md: px(6.0),
986 radius_lg: px(8.0),
987 radius_xl: px(12.0),
988
989 shadow_xs: BoxShadow {
990 offset: point(px(0.0), px(1.0)),
991 blur_radius: px(2.0),
992 spread_radius: px(0.0),
993 inset: false,
994 color: hsla(0.0, 0.0, 0.0, 0.15),
995 },
996 shadow_sm: BoxShadow {
997 offset: point(px(0.0), px(1.0)),
998 blur_radius: px(3.0),
999 spread_radius: px(0.0),
1000 inset: false,
1001 color: hsla(0.0, 0.0, 0.0, 0.2),
1002 },
1003 shadow_md: BoxShadow {
1004 offset: point(px(0.0), px(4.0)),
1005 blur_radius: px(6.0),
1006 spread_radius: px(-1.0),
1007 inset: false,
1008 color: hsla(0.0, 0.0, 0.0, 0.15),
1009 },
1010 shadow_lg: BoxShadow {
1011 offset: point(px(0.0), px(10.0)),
1012 blur_radius: px(15.0),
1013 spread_radius: px(-3.0),
1014 inset: false,
1015 color: hsla(0.0, 0.0, 0.0, 0.15),
1016 },
1017 shadow_xl: BoxShadow {
1018 offset: point(px(0.0), px(20.0)),
1019 blur_radius: px(25.0),
1020 spread_radius: px(-5.0),
1021 inset: false,
1022 color: hsla(0.0, 0.0, 0.0, 0.15),
1023 },
1024
1025 ring_offset: px(2.0),
1026
1027 transition_fast: Duration::from_millis(150),
1028 transition_base: Duration::from_millis(200),
1029 transition_slow: Duration::from_millis(300),
1030
1031 font_family: UI_FONT_FAMILY.into(),
1032 font_mono: UI_MONO_FONT_FAMILY.into(),
1033
1034 spacing_1: px(0.0),
1035 spacing_2: px(0.0),
1036 spacing_3: px(0.0),
1037 spacing_4: px(0.0),
1038 spacing_5: px(0.0),
1039 spacing_6: px(0.0),
1040 spacing_8: px(0.0),
1041 spacing_10: px(0.0),
1042 spacing_12: px(0.0),
1043 spacing_16: px(0.0),
1044 duration_fastest: Duration::ZERO,
1045 duration_faster: Duration::ZERO,
1046 duration_fast: Duration::ZERO,
1047 duration_normal: Duration::ZERO,
1048 duration_slow: Duration::ZERO,
1049 duration_slower: Duration::ZERO,
1050 duration_slowest: Duration::ZERO,
1051 z_dropdown: 0,
1052 z_sticky: 0,
1053 z_modal: 0,
1054 z_popover: 0,
1055 z_tooltip: 0,
1056 }
1057 .apply_standard()
1058 }
1059
1060 pub fn tokyo_night() -> Self {
1061 Self {
1062 background: rgb(0x16161e).into(), foreground: rgb(0xc0caf5).into(),
1064 card: rgb(0x1a1b26).into(),
1065 card_foreground: rgb(0xc0caf5).into(),
1066 popover: rgb(0x1a1b26).into(),
1067 popover_foreground: rgb(0xc0caf5).into(),
1068 muted: rgb(0x1f2335).into(),
1069 muted_foreground: rgb(0x565f89).into(),
1070 accent: rgb(0x292e42).into(),
1071 accent_foreground: rgb(0x7aa2f7).into(),
1072 primary: rgb(0x7dcfff).into(), primary_foreground: rgb(0x16161e).into(),
1074 secondary: rgb(0x292e42).into(),
1075 secondary_foreground: rgb(0xc0caf5).into(),
1076 destructive: rgb(0xf7768e).into(),
1077 destructive_foreground: rgb(0xc0caf5).into(),
1078 border: rgb(0x292e42).into(),
1079 input: rgb(0x292e42).into(),
1080 ring: rgb(0x7dcfff).into(),
1081
1082 radius_sm: px(4.0),
1083 radius_md: px(6.0),
1084 radius_lg: px(8.0),
1085 radius_xl: px(12.0),
1086
1087 shadow_xs: BoxShadow {
1088 offset: point(px(0.0), px(1.0)),
1089 blur_radius: px(2.0),
1090 spread_radius: px(0.0),
1091 inset: false,
1092 color: hsla(0.0, 0.0, 0.0, 0.15),
1093 },
1094 shadow_sm: BoxShadow {
1095 offset: point(px(0.0), px(1.0)),
1096 blur_radius: px(3.0),
1097 spread_radius: px(0.0),
1098 inset: false,
1099 color: hsla(0.0, 0.0, 0.0, 0.2),
1100 },
1101 shadow_md: BoxShadow {
1102 offset: point(px(0.0), px(4.0)),
1103 blur_radius: px(6.0),
1104 spread_radius: px(-1.0),
1105 inset: false,
1106 color: hsla(0.0, 0.0, 0.0, 0.15),
1107 },
1108 shadow_lg: BoxShadow {
1109 offset: point(px(0.0), px(10.0)),
1110 blur_radius: px(15.0),
1111 spread_radius: px(-3.0),
1112 inset: false,
1113 color: hsla(0.0, 0.0, 0.0, 0.15),
1114 },
1115 shadow_xl: BoxShadow {
1116 offset: point(px(0.0), px(20.0)),
1117 blur_radius: px(25.0),
1118 spread_radius: px(-5.0),
1119 inset: false,
1120 color: hsla(0.0, 0.0, 0.0, 0.15),
1121 },
1122
1123 ring_offset: px(2.0),
1124
1125 transition_fast: Duration::from_millis(150),
1126 transition_base: Duration::from_millis(200),
1127 transition_slow: Duration::from_millis(300),
1128
1129 font_family: UI_FONT_FAMILY.into(),
1130 font_mono: UI_MONO_FONT_FAMILY.into(),
1131
1132 spacing_1: px(0.0),
1133 spacing_2: px(0.0),
1134 spacing_3: px(0.0),
1135 spacing_4: px(0.0),
1136 spacing_5: px(0.0),
1137 spacing_6: px(0.0),
1138 spacing_8: px(0.0),
1139 spacing_10: px(0.0),
1140 spacing_12: px(0.0),
1141 spacing_16: px(0.0),
1142 duration_fastest: Duration::ZERO,
1143 duration_faster: Duration::ZERO,
1144 duration_fast: Duration::ZERO,
1145 duration_normal: Duration::ZERO,
1146 duration_slow: Duration::ZERO,
1147 duration_slower: Duration::ZERO,
1148 duration_slowest: Duration::ZERO,
1149 z_dropdown: 0,
1150 z_sticky: 0,
1151 z_modal: 0,
1152 z_popover: 0,
1153 z_tooltip: 0,
1154 }
1155 .apply_standard()
1156 }
1157
1158 pub fn catppuccin_mocha() -> Self {
1159 Self {
1160 background: rgb(0x181825).into(), foreground: rgb(0xcdd6f4).into(),
1162 card: rgb(0x1e1e2e).into(),
1163 card_foreground: rgb(0xcdd6f4).into(),
1164 popover: rgb(0x1e1e2e).into(),
1165 popover_foreground: rgb(0xcdd6f4).into(),
1166 muted: rgb(0x313244).into(),
1167 muted_foreground: rgb(0x7f849c).into(),
1168 accent: rgb(0x45475a).into(),
1169 accent_foreground: rgb(0x89b4fa).into(),
1170 primary: rgb(0x89b4fa).into(), primary_foreground: rgb(0x181825).into(),
1172 secondary: rgb(0x585b70).into(),
1173 secondary_foreground: rgb(0xcdd6f4).into(),
1174 destructive: rgb(0xf38ba8).into(),
1175 destructive_foreground: rgb(0xcdd6f4).into(),
1176 border: rgb(0x313244).into(),
1177 input: rgb(0x313244).into(),
1178 ring: rgb(0x89b4fa).into(),
1179
1180 radius_sm: px(4.0),
1181 radius_md: px(6.0),
1182 radius_lg: px(8.0),
1183 radius_xl: px(12.0),
1184
1185 shadow_xs: BoxShadow {
1186 offset: point(px(0.0), px(1.0)),
1187 blur_radius: px(2.0),
1188 spread_radius: px(0.0),
1189 inset: false,
1190 color: hsla(0.0, 0.0, 0.0, 0.15),
1191 },
1192 shadow_sm: BoxShadow {
1193 offset: point(px(0.0), px(1.0)),
1194 blur_radius: px(3.0),
1195 spread_radius: px(0.0),
1196 inset: false,
1197 color: hsla(0.0, 0.0, 0.0, 0.2),
1198 },
1199 shadow_md: BoxShadow {
1200 offset: point(px(0.0), px(4.0)),
1201 blur_radius: px(6.0),
1202 spread_radius: px(-1.0),
1203 inset: false,
1204 color: hsla(0.0, 0.0, 0.0, 0.15),
1205 },
1206 shadow_lg: BoxShadow {
1207 offset: point(px(0.0), px(10.0)),
1208 blur_radius: px(15.0),
1209 spread_radius: px(-3.0),
1210 inset: false,
1211 color: hsla(0.0, 0.0, 0.0, 0.15),
1212 },
1213 shadow_xl: BoxShadow {
1214 offset: point(px(0.0), px(20.0)),
1215 blur_radius: px(25.0),
1216 spread_radius: px(-5.0),
1217 inset: false,
1218 color: hsla(0.0, 0.0, 0.0, 0.15),
1219 },
1220
1221 ring_offset: px(2.0),
1222
1223 transition_fast: Duration::from_millis(150),
1224 transition_base: Duration::from_millis(200),
1225 transition_slow: Duration::from_millis(300),
1226
1227 font_family: UI_FONT_FAMILY.into(),
1228 font_mono: UI_MONO_FONT_FAMILY.into(),
1229
1230 spacing_1: px(0.0),
1231 spacing_2: px(0.0),
1232 spacing_3: px(0.0),
1233 spacing_4: px(0.0),
1234 spacing_5: px(0.0),
1235 spacing_6: px(0.0),
1236 spacing_8: px(0.0),
1237 spacing_10: px(0.0),
1238 spacing_12: px(0.0),
1239 spacing_16: px(0.0),
1240 duration_fastest: Duration::ZERO,
1241 duration_faster: Duration::ZERO,
1242 duration_fast: Duration::ZERO,
1243 duration_normal: Duration::ZERO,
1244 duration_slow: Duration::ZERO,
1245 duration_slower: Duration::ZERO,
1246 duration_slowest: Duration::ZERO,
1247 z_dropdown: 0,
1248 z_sticky: 0,
1249 z_modal: 0,
1250 z_popover: 0,
1251 z_tooltip: 0,
1252 }
1253 .apply_standard()
1254 }
1255
1256 pub fn rose_pine() -> Self {
1257 Self {
1258 background: rgb(0x131019).into(), foreground: rgb(0xe0def4).into(),
1260 card: rgb(0x191724).into(),
1261 card_foreground: rgb(0xe0def4).into(),
1262 popover: rgb(0x191724).into(),
1263 popover_foreground: rgb(0xe0def4).into(),
1264 muted: rgb(0x1f1d2e).into(),
1265 muted_foreground: rgb(0x6e6a86).into(),
1266 accent: rgb(0x26233a).into(),
1267 accent_foreground: rgb(0xc4a7e7).into(),
1268 primary: rgb(0xc4a7e7).into(), primary_foreground: rgb(0x131019).into(),
1270 secondary: rgb(0x2a273f).into(),
1271 secondary_foreground: rgb(0xe0def4).into(),
1272 destructive: rgb(0xeb6f92).into(),
1273 destructive_foreground: rgb(0xe0def4).into(),
1274 border: rgb(0x26233a).into(),
1275 input: rgb(0x26233a).into(),
1276 ring: rgb(0xc4a7e7).into(),
1277
1278 radius_sm: px(4.0),
1279 radius_md: px(6.0),
1280 radius_lg: px(8.0),
1281 radius_xl: px(12.0),
1282
1283 shadow_xs: BoxShadow {
1284 offset: point(px(0.0), px(1.0)),
1285 blur_radius: px(2.0),
1286 spread_radius: px(0.0),
1287 inset: false,
1288 color: hsla(0.0, 0.0, 0.0, 0.15),
1289 },
1290 shadow_sm: BoxShadow {
1291 offset: point(px(0.0), px(1.0)),
1292 blur_radius: px(3.0),
1293 spread_radius: px(0.0),
1294 inset: false,
1295 color: hsla(0.0, 0.0, 0.0, 0.2),
1296 },
1297 shadow_md: BoxShadow {
1298 offset: point(px(0.0), px(4.0)),
1299 blur_radius: px(6.0),
1300 spread_radius: px(-1.0),
1301 inset: false,
1302 color: hsla(0.0, 0.0, 0.0, 0.15),
1303 },
1304 shadow_lg: BoxShadow {
1305 offset: point(px(0.0), px(10.0)),
1306 blur_radius: px(15.0),
1307 spread_radius: px(-3.0),
1308 inset: false,
1309 color: hsla(0.0, 0.0, 0.0, 0.15),
1310 },
1311 shadow_xl: BoxShadow {
1312 offset: point(px(0.0), px(20.0)),
1313 blur_radius: px(25.0),
1314 spread_radius: px(-5.0),
1315 inset: false,
1316 color: hsla(0.0, 0.0, 0.0, 0.15),
1317 },
1318
1319 ring_offset: px(2.0),
1320
1321 transition_fast: Duration::from_millis(150),
1322 transition_base: Duration::from_millis(200),
1323 transition_slow: Duration::from_millis(300),
1324
1325 font_family: UI_FONT_FAMILY.into(),
1326 font_mono: UI_MONO_FONT_FAMILY.into(),
1327
1328 spacing_1: px(0.0),
1329 spacing_2: px(0.0),
1330 spacing_3: px(0.0),
1331 spacing_4: px(0.0),
1332 spacing_5: px(0.0),
1333 spacing_6: px(0.0),
1334 spacing_8: px(0.0),
1335 spacing_10: px(0.0),
1336 spacing_12: px(0.0),
1337 spacing_16: px(0.0),
1338 duration_fastest: Duration::ZERO,
1339 duration_faster: Duration::ZERO,
1340 duration_fast: Duration::ZERO,
1341 duration_normal: Duration::ZERO,
1342 duration_slow: Duration::ZERO,
1343 duration_slower: Duration::ZERO,
1344 duration_slowest: Duration::ZERO,
1345 z_dropdown: 0,
1346 z_sticky: 0,
1347 z_modal: 0,
1348 z_popover: 0,
1349 z_tooltip: 0,
1350 }
1351 .apply_standard()
1352 }
1353
1354 pub fn coral_reef() -> Self {
1355 Self {
1356 background: rgb(0xFFFBF8).into(), foreground: rgb(0x2D3748).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x2D3748).into(),
1360 popover: rgb(0xFFFFFF).into(),
1361 popover_foreground: rgb(0x2D3748).into(),
1362 muted: rgb(0xFFF5F0).into(), muted_foreground: rgb(0x718096).into(), accent: rgb(0xFFE4D6).into(), accent_foreground: rgb(0x2D3748).into(),
1366 primary: rgb(0xFF6B6B).into(), primary_foreground: rgb(0xFFFFFF).into(),
1368 secondary: rgb(0x4FD1C5).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1370 destructive: rgb(0xF56565).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1372 border: rgb(0xFFD4C2).into(), input: rgb(0xFFE4D6).into(),
1374 ring: rgb(0xFF6B6B).into(), radius_sm: px(6.0),
1377 radius_md: px(8.0),
1378 radius_lg: px(12.0),
1379 radius_xl: px(12.0),
1380
1381 shadow_xs: BoxShadow {
1382 offset: point(px(0.0), px(1.0)),
1383 blur_radius: px(2.0),
1384 spread_radius: px(0.0),
1385 inset: false,
1386 color: hsla(0.0, 0.0, 0.0, 0.15),
1387 },
1388 shadow_sm: BoxShadow {
1389 offset: point(px(0.0), px(1.0)),
1390 blur_radius: px(3.0),
1391 spread_radius: px(0.0),
1392 inset: false,
1393 color: hsla(0.0, 0.0, 0.0, 0.2),
1394 },
1395 shadow_md: BoxShadow {
1396 offset: point(px(0.0), px(4.0)),
1397 blur_radius: px(6.0),
1398 spread_radius: px(-1.0),
1399 inset: false,
1400 color: hsla(0.0, 0.0, 0.0, 0.15),
1401 },
1402 shadow_lg: BoxShadow {
1403 offset: point(px(0.0), px(10.0)),
1404 blur_radius: px(15.0),
1405 spread_radius: px(-3.0),
1406 inset: false,
1407 color: hsla(0.0, 0.0, 0.0, 0.15),
1408 },
1409 shadow_xl: BoxShadow {
1410 offset: point(px(0.0), px(20.0)),
1411 blur_radius: px(25.0),
1412 spread_radius: px(-5.0),
1413 inset: false,
1414 color: hsla(0.0, 0.0, 0.0, 0.15),
1415 },
1416
1417 ring_offset: px(2.0),
1418
1419 transition_fast: Duration::from_millis(150),
1420 transition_base: Duration::from_millis(200),
1421 transition_slow: Duration::from_millis(300),
1422
1423 font_family: UI_FONT_FAMILY.into(),
1424 font_mono: UI_MONO_FONT_FAMILY.into(),
1425
1426 spacing_1: px(0.0),
1427 spacing_2: px(0.0),
1428 spacing_3: px(0.0),
1429 spacing_4: px(0.0),
1430 spacing_5: px(0.0),
1431 spacing_6: px(0.0),
1432 spacing_8: px(0.0),
1433 spacing_10: px(0.0),
1434 spacing_12: px(0.0),
1435 spacing_16: px(0.0),
1436 duration_fastest: Duration::ZERO,
1437 duration_faster: Duration::ZERO,
1438 duration_fast: Duration::ZERO,
1439 duration_normal: Duration::ZERO,
1440 duration_slow: Duration::ZERO,
1441 duration_slower: Duration::ZERO,
1442 duration_slowest: Duration::ZERO,
1443 z_dropdown: 0,
1444 z_sticky: 0,
1445 z_modal: 0,
1446 z_popover: 0,
1447 z_tooltip: 0,
1448 }
1449 .apply_standard()
1450 }
1451
1452 pub fn lavender_dreams() -> Self {
1453 Self {
1454 background: rgb(0xF8F7FF).into(), foreground: rgb(0x2D2A3D).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x2D2A3D).into(),
1458 popover: rgb(0xFFFFFF).into(),
1459 popover_foreground: rgb(0x2D2A3D).into(),
1460 muted: rgb(0xF0EDFF).into(), muted_foreground: rgb(0x6B6880).into(), accent: rgb(0xE8E3FF).into(), accent_foreground: rgb(0x2D2A3D).into(),
1464 primary: rgb(0x9F7AEA).into(), primary_foreground: rgb(0xFFFFFF).into(),
1466 secondary: rgb(0xB794F6).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1468 destructive: rgb(0xE53E3E).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1470 border: rgb(0xD6CEFF).into(), input: rgb(0xE8E3FF).into(),
1472 ring: rgb(0x9F7AEA).into(), radius_sm: px(6.0),
1475 radius_md: px(8.0),
1476 radius_lg: px(12.0),
1477 radius_xl: px(12.0),
1478
1479 shadow_xs: BoxShadow {
1480 offset: point(px(0.0), px(1.0)),
1481 blur_radius: px(2.0),
1482 spread_radius: px(0.0),
1483 inset: false,
1484 color: hsla(0.0, 0.0, 0.0, 0.15),
1485 },
1486 shadow_sm: BoxShadow {
1487 offset: point(px(0.0), px(1.0)),
1488 blur_radius: px(3.0),
1489 spread_radius: px(0.0),
1490 inset: false,
1491 color: hsla(0.0, 0.0, 0.0, 0.2),
1492 },
1493 shadow_md: BoxShadow {
1494 offset: point(px(0.0), px(4.0)),
1495 blur_radius: px(6.0),
1496 spread_radius: px(-1.0),
1497 inset: false,
1498 color: hsla(0.0, 0.0, 0.0, 0.15),
1499 },
1500 shadow_lg: BoxShadow {
1501 offset: point(px(0.0), px(10.0)),
1502 blur_radius: px(15.0),
1503 spread_radius: px(-3.0),
1504 inset: false,
1505 color: hsla(0.0, 0.0, 0.0, 0.15),
1506 },
1507 shadow_xl: BoxShadow {
1508 offset: point(px(0.0), px(20.0)),
1509 blur_radius: px(25.0),
1510 spread_radius: px(-5.0),
1511 inset: false,
1512 color: hsla(0.0, 0.0, 0.0, 0.15),
1513 },
1514
1515 ring_offset: px(2.0),
1516
1517 transition_fast: Duration::from_millis(150),
1518 transition_base: Duration::from_millis(200),
1519 transition_slow: Duration::from_millis(300),
1520
1521 font_family: UI_FONT_FAMILY.into(),
1522 font_mono: UI_MONO_FONT_FAMILY.into(),
1523
1524 spacing_1: px(0.0),
1525 spacing_2: px(0.0),
1526 spacing_3: px(0.0),
1527 spacing_4: px(0.0),
1528 spacing_5: px(0.0),
1529 spacing_6: px(0.0),
1530 spacing_8: px(0.0),
1531 spacing_10: px(0.0),
1532 spacing_12: px(0.0),
1533 spacing_16: px(0.0),
1534 duration_fastest: Duration::ZERO,
1535 duration_faster: Duration::ZERO,
1536 duration_fast: Duration::ZERO,
1537 duration_normal: Duration::ZERO,
1538 duration_slow: Duration::ZERO,
1539 duration_slower: Duration::ZERO,
1540 duration_slowest: Duration::ZERO,
1541 z_dropdown: 0,
1542 z_sticky: 0,
1543 z_modal: 0,
1544 z_popover: 0,
1545 z_tooltip: 0,
1546 }
1547 .apply_standard()
1548 }
1549
1550 pub fn mint_fresh() -> Self {
1551 Self {
1552 background: rgb(0xF7FDFB).into(), foreground: rgb(0x1A4D3C).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x1A4D3C).into(),
1556 popover: rgb(0xFFFFFF).into(),
1557 popover_foreground: rgb(0x1A4D3C).into(),
1558 muted: rgb(0xE6F9F3).into(), muted_foreground: rgb(0x4A7C69).into(), accent: rgb(0xD4F4E8).into(), accent_foreground: rgb(0x1A4D3C).into(),
1562 primary: rgb(0x38B2AC).into(), primary_foreground: rgb(0xFFFFFF).into(),
1564 secondary: rgb(0x48BB78).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1566 destructive: rgb(0xF56565).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1568 border: rgb(0xB8EBD9).into(), input: rgb(0xD4F4E8).into(),
1570 ring: rgb(0x38B2AC).into(), radius_sm: px(6.0),
1573 radius_md: px(8.0),
1574 radius_lg: px(12.0),
1575 radius_xl: px(12.0),
1576
1577 shadow_xs: BoxShadow {
1578 offset: point(px(0.0), px(1.0)),
1579 blur_radius: px(2.0),
1580 spread_radius: px(0.0),
1581 inset: false,
1582 color: hsla(0.0, 0.0, 0.0, 0.15),
1583 },
1584 shadow_sm: BoxShadow {
1585 offset: point(px(0.0), px(1.0)),
1586 blur_radius: px(3.0),
1587 spread_radius: px(0.0),
1588 inset: false,
1589 color: hsla(0.0, 0.0, 0.0, 0.2),
1590 },
1591 shadow_md: BoxShadow {
1592 offset: point(px(0.0), px(4.0)),
1593 blur_radius: px(6.0),
1594 spread_radius: px(-1.0),
1595 inset: false,
1596 color: hsla(0.0, 0.0, 0.0, 0.15),
1597 },
1598 shadow_lg: BoxShadow {
1599 offset: point(px(0.0), px(10.0)),
1600 blur_radius: px(15.0),
1601 spread_radius: px(-3.0),
1602 inset: false,
1603 color: hsla(0.0, 0.0, 0.0, 0.15),
1604 },
1605 shadow_xl: BoxShadow {
1606 offset: point(px(0.0), px(20.0)),
1607 blur_radius: px(25.0),
1608 spread_radius: px(-5.0),
1609 inset: false,
1610 color: hsla(0.0, 0.0, 0.0, 0.15),
1611 },
1612
1613 ring_offset: px(2.0),
1614
1615 transition_fast: Duration::from_millis(150),
1616 transition_base: Duration::from_millis(200),
1617 transition_slow: Duration::from_millis(300),
1618
1619 font_family: UI_FONT_FAMILY.into(),
1620 font_mono: UI_MONO_FONT_FAMILY.into(),
1621
1622 spacing_1: px(0.0),
1623 spacing_2: px(0.0),
1624 spacing_3: px(0.0),
1625 spacing_4: px(0.0),
1626 spacing_5: px(0.0),
1627 spacing_6: px(0.0),
1628 spacing_8: px(0.0),
1629 spacing_10: px(0.0),
1630 spacing_12: px(0.0),
1631 spacing_16: px(0.0),
1632 duration_fastest: Duration::ZERO,
1633 duration_faster: Duration::ZERO,
1634 duration_fast: Duration::ZERO,
1635 duration_normal: Duration::ZERO,
1636 duration_slow: Duration::ZERO,
1637 duration_slower: Duration::ZERO,
1638 duration_slowest: Duration::ZERO,
1639 z_dropdown: 0,
1640 z_sticky: 0,
1641 z_modal: 0,
1642 z_popover: 0,
1643 z_tooltip: 0,
1644 }
1645 .apply_standard()
1646 }
1647
1648 pub fn peachy_keen() -> Self {
1649 Self {
1650 background: rgb(0xFFFAF5).into(), foreground: rgb(0x3D2817).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x3D2817).into(),
1654 popover: rgb(0xFFFFFF).into(),
1655 popover_foreground: rgb(0x3D2817).into(),
1656 muted: rgb(0xFFF0E0).into(), muted_foreground: rgb(0x8B6B47).into(), accent: rgb(0xFFE4CC).into(), accent_foreground: rgb(0x3D2817).into(),
1660 primary: rgb(0xFF9966).into(), primary_foreground: rgb(0xFFFFFF).into(),
1662 secondary: rgb(0xFFB84D).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1664 destructive: rgb(0xE53E3E).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1666 border: rgb(0xFFD9B3).into(), input: rgb(0xFFE4CC).into(),
1668 ring: rgb(0xFF9966).into(), radius_sm: px(6.0),
1671 radius_md: px(8.0),
1672 radius_lg: px(12.0),
1673 radius_xl: px(12.0),
1674
1675 shadow_xs: BoxShadow {
1676 offset: point(px(0.0), px(1.0)),
1677 blur_radius: px(2.0),
1678 spread_radius: px(0.0),
1679 inset: false,
1680 color: hsla(0.0, 0.0, 0.0, 0.15),
1681 },
1682 shadow_sm: BoxShadow {
1683 offset: point(px(0.0), px(1.0)),
1684 blur_radius: px(3.0),
1685 spread_radius: px(0.0),
1686 inset: false,
1687 color: hsla(0.0, 0.0, 0.0, 0.2),
1688 },
1689 shadow_md: BoxShadow {
1690 offset: point(px(0.0), px(4.0)),
1691 blur_radius: px(6.0),
1692 spread_radius: px(-1.0),
1693 inset: false,
1694 color: hsla(0.0, 0.0, 0.0, 0.15),
1695 },
1696 shadow_lg: BoxShadow {
1697 offset: point(px(0.0), px(10.0)),
1698 blur_radius: px(15.0),
1699 spread_radius: px(-3.0),
1700 inset: false,
1701 color: hsla(0.0, 0.0, 0.0, 0.15),
1702 },
1703 shadow_xl: BoxShadow {
1704 offset: point(px(0.0), px(20.0)),
1705 blur_radius: px(25.0),
1706 spread_radius: px(-5.0),
1707 inset: false,
1708 color: hsla(0.0, 0.0, 0.0, 0.15),
1709 },
1710
1711 ring_offset: px(2.0),
1712
1713 transition_fast: Duration::from_millis(150),
1714 transition_base: Duration::from_millis(200),
1715 transition_slow: Duration::from_millis(300),
1716
1717 font_family: UI_FONT_FAMILY.into(),
1718 font_mono: UI_MONO_FONT_FAMILY.into(),
1719
1720 spacing_1: px(0.0),
1721 spacing_2: px(0.0),
1722 spacing_3: px(0.0),
1723 spacing_4: px(0.0),
1724 spacing_5: px(0.0),
1725 spacing_6: px(0.0),
1726 spacing_8: px(0.0),
1727 spacing_10: px(0.0),
1728 spacing_12: px(0.0),
1729 spacing_16: px(0.0),
1730 duration_fastest: Duration::ZERO,
1731 duration_faster: Duration::ZERO,
1732 duration_fast: Duration::ZERO,
1733 duration_normal: Duration::ZERO,
1734 duration_slow: Duration::ZERO,
1735 duration_slower: Duration::ZERO,
1736 duration_slowest: Duration::ZERO,
1737 z_dropdown: 0,
1738 z_sticky: 0,
1739 z_modal: 0,
1740 z_popover: 0,
1741 z_tooltip: 0,
1742 }
1743 .apply_standard()
1744 }
1745
1746 pub fn sky_blue() -> Self {
1747 Self {
1748 background: rgb(0xF7FAFD).into(), foreground: rgb(0x1E3A5F).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x1E3A5F).into(),
1752 popover: rgb(0xFFFFFF).into(),
1753 popover_foreground: rgb(0x1E3A5F).into(),
1754 muted: rgb(0xE3F2FD).into(), muted_foreground: rgb(0x5B7C99).into(), accent: rgb(0xBBDEFB).into(), accent_foreground: rgb(0x1E3A5F).into(),
1758 primary: rgb(0x2196F3).into(), primary_foreground: rgb(0xFFFFFF).into(),
1760 secondary: rgb(0x42A5F5).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1762 destructive: rgb(0xF44336).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1764 border: rgb(0x90CAF9).into(), input: rgb(0xBBDEFB).into(),
1766 ring: rgb(0x2196F3).into(), radius_sm: px(6.0),
1769 radius_md: px(8.0),
1770 radius_lg: px(12.0),
1771 radius_xl: px(12.0),
1772
1773 shadow_xs: BoxShadow {
1774 offset: point(px(0.0), px(1.0)),
1775 blur_radius: px(2.0),
1776 spread_radius: px(0.0),
1777 inset: false,
1778 color: hsla(0.0, 0.0, 0.0, 0.15),
1779 },
1780 shadow_sm: BoxShadow {
1781 offset: point(px(0.0), px(1.0)),
1782 blur_radius: px(3.0),
1783 spread_radius: px(0.0),
1784 inset: false,
1785 color: hsla(0.0, 0.0, 0.0, 0.2),
1786 },
1787 shadow_md: BoxShadow {
1788 offset: point(px(0.0), px(4.0)),
1789 blur_radius: px(6.0),
1790 spread_radius: px(-1.0),
1791 inset: false,
1792 color: hsla(0.0, 0.0, 0.0, 0.15),
1793 },
1794 shadow_lg: BoxShadow {
1795 offset: point(px(0.0), px(10.0)),
1796 blur_radius: px(15.0),
1797 spread_radius: px(-3.0),
1798 inset: false,
1799 color: hsla(0.0, 0.0, 0.0, 0.15),
1800 },
1801 shadow_xl: BoxShadow {
1802 offset: point(px(0.0), px(20.0)),
1803 blur_radius: px(25.0),
1804 spread_radius: px(-5.0),
1805 inset: false,
1806 color: hsla(0.0, 0.0, 0.0, 0.15),
1807 },
1808
1809 ring_offset: px(2.0),
1810
1811 transition_fast: Duration::from_millis(150),
1812 transition_base: Duration::from_millis(200),
1813 transition_slow: Duration::from_millis(300),
1814
1815 font_family: UI_FONT_FAMILY.into(),
1816 font_mono: UI_MONO_FONT_FAMILY.into(),
1817
1818 spacing_1: px(0.0),
1819 spacing_2: px(0.0),
1820 spacing_3: px(0.0),
1821 spacing_4: px(0.0),
1822 spacing_5: px(0.0),
1823 spacing_6: px(0.0),
1824 spacing_8: px(0.0),
1825 spacing_10: px(0.0),
1826 spacing_12: px(0.0),
1827 spacing_16: px(0.0),
1828 duration_fastest: Duration::ZERO,
1829 duration_faster: Duration::ZERO,
1830 duration_fast: Duration::ZERO,
1831 duration_normal: Duration::ZERO,
1832 duration_slow: Duration::ZERO,
1833 duration_slower: Duration::ZERO,
1834 duration_slowest: Duration::ZERO,
1835 z_dropdown: 0,
1836 z_sticky: 0,
1837 z_modal: 0,
1838 z_popover: 0,
1839 z_tooltip: 0,
1840 }
1841 .apply_standard()
1842 }
1843
1844 pub fn cherry_blossom() -> Self {
1845 Self {
1846 background: rgb(0xFFF8FB).into(), foreground: rgb(0x4A1942).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x4A1942).into(),
1850 popover: rgb(0xFFFFFF).into(),
1851 popover_foreground: rgb(0x4A1942).into(),
1852 muted: rgb(0xFFE8F5).into(), muted_foreground: rgb(0x9B4F96).into(), accent: rgb(0xFFD6ED).into(), accent_foreground: rgb(0x4A1942).into(),
1856 primary: rgb(0xE91E63).into(), primary_foreground: rgb(0xFFFFFF).into(),
1858 secondary: rgb(0xF06292).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1860 destructive: rgb(0xE53935).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1862 border: rgb(0xFFB3D9).into(), input: rgb(0xFFD6ED).into(),
1864 ring: rgb(0xE91E63).into(), radius_sm: px(6.0),
1867 radius_md: px(8.0),
1868 radius_lg: px(12.0),
1869 radius_xl: px(12.0),
1870
1871 shadow_xs: BoxShadow {
1872 offset: point(px(0.0), px(1.0)),
1873 blur_radius: px(2.0),
1874 spread_radius: px(0.0),
1875 inset: false,
1876 color: hsla(0.0, 0.0, 0.0, 0.15),
1877 },
1878 shadow_sm: BoxShadow {
1879 offset: point(px(0.0), px(1.0)),
1880 blur_radius: px(3.0),
1881 spread_radius: px(0.0),
1882 inset: false,
1883 color: hsla(0.0, 0.0, 0.0, 0.2),
1884 },
1885 shadow_md: BoxShadow {
1886 offset: point(px(0.0), px(4.0)),
1887 blur_radius: px(6.0),
1888 spread_radius: px(-1.0),
1889 inset: false,
1890 color: hsla(0.0, 0.0, 0.0, 0.15),
1891 },
1892 shadow_lg: BoxShadow {
1893 offset: point(px(0.0), px(10.0)),
1894 blur_radius: px(15.0),
1895 spread_radius: px(-3.0),
1896 inset: false,
1897 color: hsla(0.0, 0.0, 0.0, 0.15),
1898 },
1899 shadow_xl: BoxShadow {
1900 offset: point(px(0.0), px(20.0)),
1901 blur_radius: px(25.0),
1902 spread_radius: px(-5.0),
1903 inset: false,
1904 color: hsla(0.0, 0.0, 0.0, 0.15),
1905 },
1906
1907 ring_offset: px(2.0),
1908
1909 transition_fast: Duration::from_millis(150),
1910 transition_base: Duration::from_millis(200),
1911 transition_slow: Duration::from_millis(300),
1912
1913 font_family: UI_FONT_FAMILY.into(),
1914 font_mono: UI_MONO_FONT_FAMILY.into(),
1915
1916 spacing_1: px(0.0),
1917 spacing_2: px(0.0),
1918 spacing_3: px(0.0),
1919 spacing_4: px(0.0),
1920 spacing_5: px(0.0),
1921 spacing_6: px(0.0),
1922 spacing_8: px(0.0),
1923 spacing_10: px(0.0),
1924 spacing_12: px(0.0),
1925 spacing_16: px(0.0),
1926 duration_fastest: Duration::ZERO,
1927 duration_faster: Duration::ZERO,
1928 duration_fast: Duration::ZERO,
1929 duration_normal: Duration::ZERO,
1930 duration_slow: Duration::ZERO,
1931 duration_slower: Duration::ZERO,
1932 duration_slowest: Duration::ZERO,
1933 z_dropdown: 0,
1934 z_sticky: 0,
1935 z_modal: 0,
1936 z_popover: 0,
1937 z_tooltip: 0,
1938 }
1939 .apply_standard()
1940 }
1941}
1942
1943impl ThemeTokens {
1944 pub fn gradient_primary(&self) -> gpui::Background {
1945 let c = self.primary;
1946 let darkened = hsla(c.h, c.s, (c.l - 0.08).max(0.0), c.a);
1947 gpui::linear_gradient(
1948 180.0,
1949 gpui::linear_color_stop(c, 0.0),
1950 gpui::linear_color_stop(darkened, 1.0),
1951 )
1952 }
1953
1954 pub fn gradient_surface(&self) -> gpui::Background {
1955 let c = self.card;
1956 let lightened = hsla(c.h, c.s, (c.l + 0.02).min(1.0), c.a);
1957 gpui::linear_gradient(
1958 135.0,
1959 gpui::linear_color_stop(c, 0.0),
1960 gpui::linear_color_stop(lightened, 1.0),
1961 )
1962 }
1963
1964 pub fn gradient_accent(&self) -> gpui::Background {
1965 let c = self.accent;
1966 let darkened = hsla(c.h, c.s, (c.l - 0.06).max(0.0), c.a);
1967 gpui::linear_gradient(
1968 180.0,
1969 gpui::linear_color_stop(c, 0.0),
1970 gpui::linear_color_stop(darkened, 1.0),
1971 )
1972 }
1973
1974 pub fn gradient_destructive(&self) -> gpui::Background {
1975 let c = self.destructive;
1976 let darkened = hsla(c.h, c.s, (c.l - 0.08).max(0.0), c.a);
1977 gpui::linear_gradient(
1978 180.0,
1979 gpui::linear_color_stop(c, 0.0),
1980 gpui::linear_color_stop(darkened, 1.0),
1981 )
1982 }
1983
1984 pub fn glow_shadow(&self, color: Hsla, intensity: f32) -> BoxShadow {
1985 BoxShadow {
1986 color: color.opacity(0.4 * intensity),
1987 offset: point(px(0.0), px(0.0)),
1988 blur_radius: px(20.0 * intensity),
1989 spread_radius: px(2.0),
1990 inset: false,
1991 }
1992 }
1993
1994 pub fn colored_shadow(&self, color: Hsla, size: f32) -> BoxShadow {
1995 BoxShadow {
1996 color: color.opacity(0.25),
1997 offset: point(px(0.0), px(2.0 * size)),
1998 blur_radius: px(8.0 * size),
1999 spread_radius: px(0.0),
2000 inset: false,
2001 }
2002 }
2003
2004 pub fn focus_ring_animated(&self, progress: f32) -> BoxShadow {
2005 BoxShadow {
2006 offset: point(px(0.0), px(0.0)),
2007 blur_radius: px(0.0),
2008 spread_radius: px(3.0 * progress),
2009 inset: false,
2010 color: self.ring.opacity(0.5 * progress),
2011 }
2012 }
2013
2014 pub fn focus_ring(&self, opacity: f32) -> BoxShadow {
2016 BoxShadow {
2017 offset: point(px(0.0), px(0.0)),
2018 blur_radius: px(0.0),
2019 spread_radius: px(3.0),
2020 inset: false,
2021 color: self.ring.opacity(opacity),
2022 }
2023 }
2024
2025 pub fn focus_ring_light(&self) -> BoxShadow {
2027 self.focus_ring(0.5)
2028 }
2029
2030 pub fn focus_ring_dark(&self) -> BoxShadow {
2032 self.focus_ring(0.4)
2033 }
2034
2035 pub fn error_ring(&self) -> BoxShadow {
2037 BoxShadow {
2038 offset: point(px(0.0), px(0.0)),
2039 blur_radius: px(0.0),
2040 spread_radius: px(3.0),
2041 inset: false,
2042 color: self.destructive.opacity(0.2),
2043 }
2044 }
2045
2046 pub fn success_ring(&self) -> BoxShadow {
2048 let success_color = hsla(0.33, 0.70, 0.50, 1.0);
2049 BoxShadow {
2050 offset: point(px(0.0), px(0.0)),
2051 blur_radius: px(0.0),
2052 spread_radius: px(3.0),
2053 inset: false,
2054 color: success_color.opacity(0.2),
2055 }
2056 }
2057
2058 pub fn inset_shadow_top(&self, intensity: f32) -> BoxShadow {
2059 BoxShadow {
2060 offset: point(px(0.0), px(2.0)),
2061 blur_radius: px(4.0),
2062 spread_radius: px(-1.0),
2063 inset: true,
2064 color: hsla(0.0, 0.0, 0.0, 0.08 * intensity),
2065 }
2066 }
2067
2068 pub fn inset_shadow_bottom(&self, intensity: f32) -> BoxShadow {
2069 BoxShadow {
2070 offset: point(px(0.0), px(-2.0)),
2071 blur_radius: px(4.0),
2072 spread_radius: px(-1.0),
2073 inset: true,
2074 color: hsla(0.0, 0.0, 0.0, 0.08 * intensity),
2075 }
2076 }
2077
2078 pub fn inset_shadow_both(&self, intensity: f32) -> Vec<BoxShadow> {
2079 vec![
2080 self.inset_shadow_top(intensity),
2081 self.inset_shadow_bottom(intensity),
2082 ]
2083 }
2084
2085 pub fn elevation_shadow(&self, level: u8) -> Vec<BoxShadow> {
2086 match level {
2087 0 => vec![],
2088 1 => vec![self.shadow_xs.clone()],
2089 2 => vec![self.shadow_sm.clone()],
2090 3 => vec![self.shadow_md.clone()],
2091 4 => vec![self.shadow_lg.clone()],
2092 _ => vec![self.shadow_xl.clone()],
2093 }
2094 }
2095
2096 pub fn layered_gradient(&self, angle: f32, colors: &[Hsla]) -> Vec<gpui::Background> {
2097 if colors.len() < 2 {
2098 return vec![];
2099 }
2100
2101 let mut layers = Vec::new();
2102 for window in colors.windows(2) {
2103 layers.push(gpui::linear_gradient(
2104 angle,
2105 gpui::linear_color_stop(window[0], 0.0),
2106 gpui::linear_color_stop(window[1], 1.0),
2107 ));
2108 }
2109 layers
2110 }
2111}