forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiBfbc29d1Tahinli2 months ago972 commits

theme.rs1465 lines, 64.3 KiBHistoryRawDownload
1//! The one place this editor knows a colour.
2//!
3//! Every paint in every region reads a token from this table and nothing else:
4//! a `0x` literal anywhere but this file is the bug the whole redesign is about
5//! (`no_colour_is_written_outside_the_theme` is the guard). Names say the
6//! *role*, never the shade -- `bg/panel`, not "the dark grey" -- so the palette
7//! can be swapped whole without touching a single element.
8//!
9//! Which is what the modules below are for. Every family carries the same role
10//! names, so the switch between them is one field lookup and no call site knows
11//! it happened -- and a role missing from any of them is a compile error rather
12//! than a region that quietly kept the old colour.
13//!
14//! * `cool` (default) -- near-black ground, cool neutral chrome, one cyan accent.
15//! * `warm` -- a deep neutral warmed towards brown so no surface reads as
16//! office grey, with one coral accent.
17//! * `forest` -- a green-tinted ground under one emerald accent.
18//! * `violet` -- an indigo ground under one lavender accent.
19//! * `rose` -- a neutral ground the accent alone warms, in rose.
20//! * `amber` -- a graphite ground under one gold accent.
21//! * `ocean` -- a blue-black ground under one azure accent.
22//! * `ice` -- the crisp one: a near-black blue ground, pale ice-blue accent.
23//! * `orchid` -- a dark plum ground under one orchid accent.
24//! * `nord`, `gruvbox`, `dracula` -- the three open palettes people already
25//! have their editors in, mapped onto these roles rather than approximated.
26//!
27//! All twelve are dark: colour work is judged against its surround, and a light
28//! ground pushes every clip body and every graded frame the wrong way -- which
29//! is why no editor of this kind ships one. All twelve take the clip bodies from
30//! the cross-NLE kind convention (video blue, audio green, image teal, text
31//! purple) instead of four greys that differ by a hair, and all twelve are held
32//! to the same measured floors: the contrast and tint guards in `main.rs` run
33//! against *every* palette in [`PaletteId::ALL`], so the thirteenth lands gated
34//! rather than untested.
35//!
36//! Which family is in force is the user's, picked from the toolbar's Theme
37//! button or its stroke and kept in `~/.config/edith/theme` beside the
38//! keybindings -- it used to be a compile feature, which is a choice only
39//! whoever built the binary could make. A token is a call now
40//! ([`BG_PANEL()`]): one relaxed load and one field read off a `'static`
41//! table, which is what "the palette can be swapped whole" costs at paint time.
42
43use std::path::PathBuf;
44use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
45
46/// The whole table, once: every role and its type, gathered from each family's
47/// module below. One list, so a role added to [`Palette`] without a value in
48/// every family is a compile error, and a role read at a paint cannot come from
49/// anywhere but the palette in force.
50///
51/// corner-cut: the families are spelled out in [`PALETTES`] rather than derived
52/// from a second list -- `macro_rules!` cannot nest a repetition over families
53/// inside one over roles, and the escape hatch for that is unstable. Ceiling: a
54/// thirteenth family is one line there, one variant in [`PaletteId`], one
55/// module.
56macro_rules! palette {
57 ($($name:ident: $ty:ty),+ $(,)?) => {
58 /// One family's numbers, in a struct so the set can be swapped whole.
59 /// Field names are the role names the whole editor already paints by,
60 /// which is why they shout.
61 #[allow(non_snake_case)]
62 #[derive(Clone, Copy, PartialEq, Debug)]
63 pub struct Palette { $(pub $name: $ty,)+ }
64
65 /// The families in [`PaletteId::ALL`]'s order, so the index the atomic
66 /// holds is the id itself.
67 static PALETTES: [Palette; PaletteId::ALL.len()] = [
68 Palette { $($name: cool::$name,)+ },
69 Palette { $($name: warm::$name,)+ },
70 Palette { $($name: forest::$name,)+ },
71 Palette { $($name: violet::$name,)+ },
72 Palette { $($name: rose::$name,)+ },
73 Palette { $($name: amber::$name,)+ },
74 Palette { $($name: ocean::$name,)+ },
75 Palette { $($name: ice::$name,)+ },
76 Palette { $($name: orchid::$name,)+ },
77 Palette { $($name: nord::$name,)+ },
78 Palette { $($name: gruvbox::$name,)+ },
79 Palette { $($name: dracula::$name,)+ },
80 Palette { $($name: darkroom::$name,)+ },
81 ];
82
83 $(
84 #[allow(non_snake_case)]
85 // corner-cut: the Darkroom substrate roles (INK1.. SAFELIGHT_GLYPH)
86 // have no call site yet -- this task owns theme.rs only and wires
87 // the table, not the paints. Ceiling: drop this attribute once the
88 // render-side task in the same DESIGN §12 package reads them.
89 #[allow(dead_code)]
90 #[inline]
91 pub fn $name() -> $ty { palette().$name }
92 )+
93 };
94}
95
96palette! {
97 BG_CANVAS: u32,
98 BG_PANEL: u32,
99 BG_RAISED: u32,
100 BG_TIMELINE: u32,
101 BG_HOVER: u32,
102 BG_HOVER_DIM: u32,
103 BG_SELECTED: u32,
104 SCRIM: u32,
105 SCRIM_LIGHT: u32,
106 STROKE_DIVIDER: u32,
107 STROKE_SELECTED: u32,
108 FG_PRIMARY: u32,
109 FG_SECONDARY: u32,
110 FG_DISABLED: u32,
111 ACCENT_PRIMARY: u32,
112 ACCENT_HOVER: u32,
113 ACCENT_PLAYHEAD: u32,
114 ACCENT_WASH: u32,
115 CLIP_VIDEO: u32,
116 CLIP_AUDIO: u32,
117 CLIP_IMAGE: u32,
118 CLIP_TEXT: u32,
119 SOURCE_TINTS: [u32; 12],
120 STATUS_ERROR: u32,
121 STATUS_WARNING: u32,
122 STATUS_SUCCESS: u32,
123 STATUS_PROGRESS: u32,
124 DROP_REFUSE: u32,
125 SUB_FG: u32,
126 SUB_SHADE: u32,
127 EQ_GRID: u32,
128 EQ_SPECTRUM_INK: u32,
129 EQ_FILL_INK: u32,
130 EQ_BELL_INK: u32,
131 HIST_INK: [u32; 3],
132 // -- Darkroom token substrate (DESIGN.md §2) --------------------------------
133 INK1: u32,
134 INK2: u32,
135 INK3: u32,
136 INK4: u32,
137 DARK_CANVAS: u32,
138 DARK_PANEL: u32,
139 DARK_RAISED: u32,
140 DARK_HAIRLINE: u32,
141 DARK_SEAM: u32,
142 LAMP_WHITE: u32,
143 NOTICE_TELL: u32,
144 NOTICE_LOOK: u32,
145 NOTICE_DECIDE: u32,
146 SAFELIGHT_GROUND: u32,
147 SAFELIGHT_GLYPH: u32,
148}
149
150/// Which family a person picked. An enum and not a bool: the door in the
151/// toolbar is a list rather than a toggle precisely because the next family
152/// must cost one variant here, one module below, and nothing anywhere else.
153#[derive(Clone, Copy, PartialEq, Eq, Debug)]
154pub enum PaletteId {
155 Cool,
156 Warm,
157 Forest,
158 Violet,
159 Rose,
160 Amber,
161 Ocean,
162 Ice,
163 Orchid,
164 Nord,
165 Gruvbox,
166 Dracula,
167 Darkroom,
168}
169
170impl PaletteId {
171 /// Display order -- the picker lists them in it, and the index into
172 /// [`PALETTES`] *is* the position in it, so this order and that array are
173 /// the same order or every colour is wrong.
174 pub const ALL: [PaletteId; 13] = [
175 PaletteId::Cool,
176 PaletteId::Warm,
177 PaletteId::Forest,
178 PaletteId::Violet,
179 PaletteId::Rose,
180 PaletteId::Amber,
181 PaletteId::Ocean,
182 PaletteId::Ice,
183 PaletteId::Orchid,
184 PaletteId::Nord,
185 PaletteId::Gruvbox,
186 PaletteId::Dracula,
187 PaletteId::Darkroom,
188 ];
189
190 /// What the button and the picker row call it.
191 pub fn label(self) -> &'static str {
192 match self {
193 PaletteId::Cool => "Cool",
194 PaletteId::Warm => "Warm",
195 PaletteId::Forest => "Forest",
196 PaletteId::Violet => "Violet",
197 PaletteId::Rose => "Rose",
198 PaletteId::Amber => "Amber",
199 PaletteId::Ocean => "Ocean",
200 PaletteId::Ice => "Ice",
201 PaletteId::Orchid => "Orchid",
202 PaletteId::Nord => "Nord",
203 PaletteId::Gruvbox => "Gruvbox",
204 PaletteId::Dracula => "Dracula",
205 PaletteId::Darkroom => "Darkroom",
206 }
207 }
208
209 /// The small print beside the row: what the family actually looks like, so
210 /// the choice is made before the click rather than after it. Short enough
211 /// to sit in the list's right-hand column at the 640x360 floor -- past
212 /// thirty characters it is truncated mid-word, which is a description that
213 /// describes nothing.
214 pub fn detail(self) -> &'static str {
215 match self {
216 PaletteId::Cool => "near-black ground, cyan accent",
217 PaletteId::Warm => "warm ground, coral accent",
218 PaletteId::Forest => "green ground, emerald",
219 PaletteId::Violet => "indigo ground, lavender",
220 PaletteId::Rose => "neutral ground, rose",
221 PaletteId::Amber => "graphite ground, gold",
222 PaletteId::Ocean => "blue-black ground, azure",
223 PaletteId::Ice => "near-black blue, pale ice",
224 PaletteId::Orchid => "plum ground, orchid accent",
225 PaletteId::Nord => "polar night, frost accent",
226 PaletteId::Gruvbox => "retro brown, gruvbox orange",
227 PaletteId::Dracula => "dracula ground, pink accent",
228 PaletteId::Darkroom => "dark ground, no chrome hue",
229 }
230 }
231
232 /// What the file calls it: one word, never the label, which is free to be
233 /// reworded ([`crate::keymap`]'s rule for the same reason).
234 pub fn name(self) -> &'static str {
235 match self {
236 PaletteId::Cool => "cool",
237 PaletteId::Warm => "warm",
238 PaletteId::Forest => "forest",
239 PaletteId::Violet => "violet",
240 PaletteId::Rose => "rose",
241 PaletteId::Amber => "amber",
242 PaletteId::Ocean => "ocean",
243 PaletteId::Ice => "ice",
244 PaletteId::Orchid => "orchid",
245 PaletteId::Nord => "nord",
246 PaletteId::Gruvbox => "gruvbox",
247 PaletteId::Dracula => "dracula",
248 PaletteId::Darkroom => "darkroom",
249 }
250 }
251
252 fn from_name(name: &str) -> Option<Self> {
253 Self::ALL.into_iter().find(|p| p.name() == name)
254 }
255
256 /// The numbers themselves, for anything that has to measure a family that
257 /// is not the one in force -- which is only the contrast guards, so it sits
258 /// with them rather than in the binary.
259 #[cfg(test)]
260 pub fn palette(self) -> &'static Palette {
261 &PALETTES[self as usize]
262 }
263}
264
265/// The family in force, as an index into [`PALETTES`]. An atomic because a
266/// token is read from whatever thread happens to be painting and the value is
267/// one `usize`; relaxed because nothing is published *with* it -- the next
268/// repaint reads it, and the swap asks for that repaint itself.
269static ACTIVE: AtomicUsize = AtomicUsize::new(0);
270
271/// The numbers every token function reads. One load, one bounds-checked index
272/// into a `'static` table: no allocation, no hashing, no lock.
273#[inline]
274pub fn palette() -> &'static Palette {
275 PALETTES.get(ACTIVE.load(Relaxed)).unwrap_or(&PALETTES[0])
276}
277
278/// Which family is in force -- what the button says and the picker marks.
279pub fn active() -> PaletteId {
280 PaletteId::ALL
281 .get(ACTIVE.load(Relaxed))
282 .copied()
283 .unwrap_or(PaletteId::Cool)
284}
285
286/// Puts `id` in force. Every paint after this reads the new numbers; asking for
287/// the repaint is the caller's, since only it holds the window.
288pub fn set(id: PaletteId) {
289 ACTIVE.store(id as usize, Relaxed);
290}
291
292/// Where the pick lives: one word in a file beside the keybindings, so a
293/// desktop that names an XDG directory is obeyed for both.
294pub fn config_path() -> PathBuf {
295 crate::keymap::Keymap::config_path().with_file_name("theme")
296}
297
298/// The pick from the last session, if there was one. Anything unreadable or
299/// unknown leaves the default in force: a theme file is not the user's work,
300/// so a bad one is worth no message at startup.
301pub fn load() {
302 if let Ok(text) = std::fs::read_to_string(config_path())
303 && let Some(id) = PaletteId::from_name(text.trim())
304 {
305 set(id);
306 }
307}
308
309/// Writes the pick. One word, written whole -- a torn write costs the theme and
310/// nothing else, and [`load`] falls back to the default on one.
311pub fn save(id: PaletteId) -> std::io::Result<()> {
312 let path = config_path();
313 if let Some(dir) = path.parent() {
314 std::fs::create_dir_all(dir)?;
315 }
316 std::fs::write(path, format!("{}\n", id.name()))
317}
318
319/// Family B: near-black ground, cool neutral chrome, one cyan accent.
320pub mod cool {
321 // -- surfaces ---------------------------------------------------------------
322 /// The app's base, and the bed a picture is letterboxed against: darker than
323 /// every panel, so the picture is what the eye lands on.
324 pub const BG_CANVAS: u32 = 0x0b0d10;
325 /// The library, the inspector, the toolbar: the chrome the work sits between.
326 pub const BG_PANEL: u32 = 0x151a21;
327 /// Buttons, menu bodies, cards -- one plane up from the panel. Flat: the
328 /// separation is colour, never a shadow.
329 pub const BG_RAISED: u32 = 0x212936;
330 /// The lane bed, darker than the panel so a clip reads as an object on it.
331 pub const BG_TIMELINE: u32 = 0x0e1218;
332 /// One step lighter than whatever it sits on: the pointer's answer that this
333 /// is clickable.
334 pub const BG_HOVER: u32 = 0x2f3a4a;
335 /// The same answer for the things that stand on the panel rather than on a
336 /// button.
337 pub const BG_HOVER_DIM: u32 = 0x1d2531;
338 /// A picked row, a picked clip: the accent at surface brightness, so a
339 /// selection is tinted rather than lit up.
340 pub const BG_SELECTED: u32 = 0x0d4b5c;
341 /// What a card is floated over when it is genuinely modal (the export, the
342 /// actions list). Inspector sections never draw one -- they occlude nothing.
343 pub const SCRIM: u32 = 0x0b0d10cc;
344 /// The lighter scrim: the picker list floats over a card that is still being
345 /// read, so it dims rather than hides.
346 pub const SCRIM_LIGHT: u32 = 0x0b0d1055;
347
348 // -- strokes ----------------------------------------------------------------
349 pub const STROKE_DIVIDER: u32 = 0x2a3442;
350 pub const STROKE_SELECTED: u32 = 0x22d3ee;
351
352 // -- text -------------------------------------------------------------------
353 pub const FG_PRIMARY: u32 = 0xe9eff7;
354 /// Shortcuts, dismissal hints, detail lines. Past 4.5:1 on every surface
355 /// above.
356 pub const FG_SECONDARY: u32 = 0xa7b6c9;
357 pub const FG_DISABLED: u32 = 0x6c7a8b;
358
359 // -- interaction ------------------------------------------------------------
360 pub const ACCENT_PRIMARY: u32 = 0x22d3ee;
361 /// The accent under the pointer: lighter, still the accent.
362 pub const ACCENT_HOVER: u32 = 0x67e8f9;
363 /// Not the accent: the playhead crosses every clip colour there is and has
364 /// to stay the one line that is none of them.
365 pub const ACCENT_PLAYHEAD: u32 = 0xff9db0;
366 /// The accent as a translucent wash, for the marks drawn over a clip body.
367 pub const ACCENT_WASH: u32 = 0x22d3eeaa;
368
369 // -- clip kinds (cross-NLE convention) --------------------------------------
370 pub const CLIP_VIDEO: u32 = 0x2b5fa8;
371 pub const CLIP_AUDIO: u32 = 0x276b43;
372 pub const CLIP_IMAGE: u32 = 0x1a6a6a;
373 pub const CLIP_TEXT: u32 = 0x6b46c1;
374
375 /// One per source, so a clip that came from an imported file reads as coming
376 /// from somewhere else than its neighbour. The *kind* is the body colour now
377 /// ([`super::clip_kind`]); this is the identity stripe and the library
378 /// swatch, and it only has to be four things telling each other apart.
379 pub const SOURCE_TINTS: [u32; 12] = [
380 0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6, 0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6, 0x4f8fd6,
381 0xd69a4f, 0x4fd6a8, 0xb14fd6,
382 ];
383
384 // -- feedback ---------------------------------------------------------------
385 pub const STATUS_ERROR: u32 = 0xef4444;
386 pub const STATUS_WARNING: u32 = 0xf59e0b;
387 pub const STATUS_SUCCESS: u32 = 0x34d399;
388 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
389 /// The mirror of [`BG_SELECTED`]: a drop the lane will not take, tinting the
390 /// shadow the drag draws so a refusal is seen before the release.
391 pub const DROP_REFUSE: u32 = 0x8f2740;
392
393 // -- subtitles (drawn over the picture, so they own their own contrast) -----
394 pub const SUB_FG: u32 = 0xffffff;
395 pub const SUB_SHADE: u32 = 0x000000cc;
396
397 // -- the equalizer graph and the histogram ----------------------------------
398 pub const EQ_GRID: u32 = 0x2a3442;
399 pub const EQ_SPECTRUM_INK: u32 = 0x7f95ad66;
400 pub const EQ_FILL_INK: u32 = 0x22d3ee26;
401 pub const EQ_BELL_INK: u32 = 0x22d3ee66;
402 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
403 // -- Darkroom token substrate: aliased onto this family's nearest role -----
404 pub const INK1: u32 = FG_PRIMARY;
405 pub const INK2: u32 = FG_SECONDARY;
406 pub const INK3: u32 = FG_DISABLED;
407 pub const INK4: u32 = FG_DISABLED;
408 pub const DARK_CANVAS: u32 = BG_CANVAS;
409 pub const DARK_PANEL: u32 = BG_PANEL;
410 pub const DARK_RAISED: u32 = BG_RAISED;
411 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
412 pub const DARK_SEAM: u32 = SCRIM;
413 pub const LAMP_WHITE: u32 = 0xffffff;
414 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
415 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
416 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
417 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
418 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
419}
420
421/// Family A: a warm consumer-editor ground (Movavi's bed, CapCut's saturation)
422/// with one coral accent that is never used for anything but "this is live,
423/// press this". Same roles, same measured floors, different numbers.
424pub mod warm {
425 // -- surfaces ---------------------------------------------------------------
426 pub const BG_CANVAS: u32 = 0x0c0a09;
427 pub const BG_PANEL: u32 = 0x1d1917;
428 pub const BG_RAISED: u32 = 0x383029;
429 pub const BG_TIMELINE: u32 = 0x151211;
430 pub const BG_HOVER: u32 = 0x4a413b;
431 pub const BG_HOVER_DIM: u32 = 0x241f1d;
432 /// Darker than the family it came from: at V3's own `0x7a3a1c` the secondary
433 /// ink on a picked row measures 4.09:1 and WCAG 1.4.3 wants 4.5, which the
434 /// cool table's guard caught the moment this became a second palette.
435 pub const BG_SELECTED: u32 = 0x6a3118;
436 pub const SCRIM: u32 = 0x0c0a09cc;
437 pub const SCRIM_LIGHT: u32 = 0x0c0a0955;
438
439 // -- strokes ----------------------------------------------------------------
440 pub const STROKE_DIVIDER: u32 = 0x3a322e;
441 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
442
443 // -- text -------------------------------------------------------------------
444 pub const FG_PRIMARY: u32 = 0xf2ece6;
445 pub const FG_SECONDARY: u32 = 0xbdb1a8;
446 pub const FG_DISABLED: u32 = 0x8a7f78;
447
448 // -- interaction ------------------------------------------------------------
449 pub const ACCENT_PRIMARY: u32 = 0xff7a45;
450 pub const ACCENT_HOVER: u32 = 0xff9a6e;
451 /// Warmer still than the accent, because it crosses everything the accent is
452 /// drawn on and has to stay findable over a selected clip.
453 pub const ACCENT_PLAYHEAD: u32 = 0xffc23a;
454 pub const ACCENT_WASH: u32 = 0xff7a45aa;
455
456 // -- clip kinds (the same cross-NLE convention, at this family's weight) ----
457 pub const CLIP_VIDEO: u32 = 0x2b4c7e;
458 pub const CLIP_AUDIO: u32 = 0x2c5a3a;
459 pub const CLIP_IMAGE: u32 = 0x1f5560;
460 pub const CLIP_TEXT: u32 = 0x4a3070;
461
462 /// Warm-side identity stripes: the same four-way distinctness the cool
463 /// family's are held to, in hues that belong to this ground.
464 pub const SOURCE_TINTS: [u32; 12] = [
465 0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8, 0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8, 0xe08a4f,
466 0x4fa8d6, 0x8fc94f, 0xd67aa8,
467 ];
468
469 // -- feedback ---------------------------------------------------------------
470 pub const STATUS_ERROR: u32 = 0xc85050;
471 pub const STATUS_WARNING: u32 = 0xe0a53a;
472 pub const STATUS_SUCCESS: u32 = 0x4fbf72;
473 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
474 pub const DROP_REFUSE: u32 = 0x8a2f24;
475
476 // -- subtitles --------------------------------------------------------------
477 pub const SUB_FG: u32 = 0xffffff;
478 pub const SUB_SHADE: u32 = 0x000000cc;
479
480 // -- the equalizer graph and the histogram ----------------------------------
481 pub const EQ_GRID: u32 = 0x4a413b;
482 pub const EQ_SPECTRUM_INK: u32 = 0xbdb1a866;
483 pub const EQ_FILL_INK: u32 = 0xff7a4526;
484 pub const EQ_BELL_INK: u32 = 0xff7a4566;
485 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
486 // -- Darkroom token substrate: aliased onto this family's nearest role -----
487 pub const INK1: u32 = FG_PRIMARY;
488 pub const INK2: u32 = FG_SECONDARY;
489 pub const INK3: u32 = FG_DISABLED;
490 pub const INK4: u32 = FG_DISABLED;
491 pub const DARK_CANVAS: u32 = BG_CANVAS;
492 pub const DARK_PANEL: u32 = BG_PANEL;
493 pub const DARK_RAISED: u32 = BG_RAISED;
494 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
495 pub const DARK_SEAM: u32 = SCRIM;
496 pub const LAMP_WHITE: u32 = 0xffffff;
497 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
498 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
499 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
500 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
501 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
502}
503
504/// Family C: the ground itself green, dark enough that a graded frame is still
505/// the brightest thing on screen, with one emerald accent. The playhead goes
506/// pink here for the same reason it is pink in `cool`: it crosses the emerald
507/// and every clip body, so it may belong to none of them.
508pub mod forest {
509 // -- surfaces ---------------------------------------------------------------
510 pub const BG_CANVAS: u32 = 0x080d0a;
511 pub const BG_PANEL: u32 = 0x121b16;
512 pub const BG_RAISED: u32 = 0x1e2c24;
513 pub const BG_TIMELINE: u32 = 0x0b1310;
514 pub const BG_HOVER: u32 = 0x2c4034;
515 pub const BG_HOVER_DIM: u32 = 0x1a2620;
516 /// Deeper than the accent it is made of: the dim ink on a picked row is held
517 /// to 4.5:1 like every other family's (WCAG 1.4.3), and emerald at surface
518 /// brightness will not carry it.
519 pub const BG_SELECTED: u32 = 0x14503a;
520 pub const SCRIM: u32 = 0x080d0acc;
521 pub const SCRIM_LIGHT: u32 = 0x080d0a55;
522
523 // -- strokes ----------------------------------------------------------------
524 pub const STROKE_DIVIDER: u32 = 0x25362c;
525 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
526
527 // -- text -------------------------------------------------------------------
528 pub const FG_PRIMARY: u32 = 0xe7f3eb;
529 pub const FG_SECONDARY: u32 = 0xa8c4b4;
530 pub const FG_DISABLED: u32 = 0x6e8579;
531
532 // -- interaction ------------------------------------------------------------
533 pub const ACCENT_PRIMARY: u32 = 0x34d399;
534 pub const ACCENT_HOVER: u32 = 0x6ee7b7;
535 pub const ACCENT_PLAYHEAD: u32 = 0xff9db0;
536 pub const ACCENT_WASH: u32 = 0x34d399aa;
537
538 // -- clip kinds (the cross-NLE convention, at this family's weight) ---------
539 pub const CLIP_VIDEO: u32 = 0x2b5fa8;
540 /// Darker than the other families' green: on a green ground a clip body has
541 /// to be the object and the bed the hole, and the dim ink on it still owes
542 /// 3:1 (WCAG 1.4.11).
543 pub const CLIP_AUDIO: u32 = 0x256b44;
544 pub const CLIP_IMAGE: u32 = 0x1a6a6a;
545 pub const CLIP_TEXT: u32 = 0x6b46c1;
546
547 pub const SOURCE_TINTS: [u32; 12] = [
548 0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6, 0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6, 0x5fd68f,
549 0xd6a45f, 0x5fa8d6, 0xc15fd6,
550 ];
551
552 // -- feedback ---------------------------------------------------------------
553 /// Not the accent family: a success that wore the emerald would say "this is
554 /// live" in the same colour the whole window says it in.
555 pub const STATUS_ERROR: u32 = 0xf07171;
556 pub const STATUS_WARNING: u32 = 0xe3b341;
557 pub const STATUS_SUCCESS: u32 = 0x7bd88f;
558 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
559 pub const DROP_REFUSE: u32 = 0x7a2a33;
560
561 // -- subtitles --------------------------------------------------------------
562 pub const SUB_FG: u32 = 0xffffff;
563 pub const SUB_SHADE: u32 = 0x000000cc;
564
565 // -- the equalizer graph and the histogram ----------------------------------
566 pub const EQ_GRID: u32 = 0x25362c;
567 pub const EQ_SPECTRUM_INK: u32 = 0xa8c4b466;
568 pub const EQ_FILL_INK: u32 = 0x34d39926;
569 pub const EQ_BELL_INK: u32 = 0x34d39966;
570 /// The three channel inks are the picture's own R, G and B: they mean the
571 /// same thing in every family, so they are the same numbers in every family.
572 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
573 // -- Darkroom token substrate: aliased onto this family's nearest role -----
574 pub const INK1: u32 = FG_PRIMARY;
575 pub const INK2: u32 = FG_SECONDARY;
576 pub const INK3: u32 = FG_DISABLED;
577 pub const INK4: u32 = FG_DISABLED;
578 pub const DARK_CANVAS: u32 = BG_CANVAS;
579 pub const DARK_PANEL: u32 = BG_PANEL;
580 pub const DARK_RAISED: u32 = BG_RAISED;
581 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
582 pub const DARK_SEAM: u32 = SCRIM;
583 pub const LAMP_WHITE: u32 = 0xffffff;
584 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
585 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
586 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
587 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
588 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
589}
590
591/// Family D: an indigo ground with one lavender accent -- the cold end of the
592/// set, where `cool` is neutral-cold and this one is frankly blue. The playhead
593/// is the yellow that is furthest from everything in it.
594pub mod violet {
595 // -- surfaces ---------------------------------------------------------------
596 pub const BG_CANVAS: u32 = 0x0a0a12;
597 pub const BG_PANEL: u32 = 0x171827;
598 pub const BG_RAISED: u32 = 0x252842;
599 pub const BG_TIMELINE: u32 = 0x0e0f1b;
600 pub const BG_HOVER: u32 = 0x353a5e;
601 pub const BG_HOVER_DIM: u32 = 0x1f2138;
602 pub const BG_SELECTED: u32 = 0x3b2a78;
603 pub const SCRIM: u32 = 0x0a0a12cc;
604 pub const SCRIM_LIGHT: u32 = 0x0a0a1255;
605
606 // -- strokes ----------------------------------------------------------------
607 pub const STROKE_DIVIDER: u32 = 0x2e3150;
608 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
609
610 // -- text -------------------------------------------------------------------
611 pub const FG_PRIMARY: u32 = 0xeceafb;
612 pub const FG_SECONDARY: u32 = 0xb6b4d8;
613 pub const FG_DISABLED: u32 = 0x7b79a0;
614
615 // -- interaction ------------------------------------------------------------
616 pub const ACCENT_PRIMARY: u32 = 0xa78bfa;
617 pub const ACCENT_HOVER: u32 = 0xc4b5fd;
618 pub const ACCENT_PLAYHEAD: u32 = 0xfacc15;
619 pub const ACCENT_WASH: u32 = 0xa78bfaaa;
620
621 // -- clip kinds -------------------------------------------------------------
622 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
623 pub const CLIP_AUDIO: u32 = 0x2c6b49;
624 pub const CLIP_IMAGE: u32 = 0x1c6270;
625 /// A shade off the accent on purpose: a text clip and "press this" must not
626 /// be the same purple.
627 pub const CLIP_TEXT: u32 = 0x6d3fa8;
628
629 pub const SOURCE_TINTS: [u32; 12] = [
630 0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4, 0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4, 0x9b7fe8,
631 0xe8a97f, 0x7fc8e8, 0xe87fb4,
632 ];
633
634 // -- feedback ---------------------------------------------------------------
635 pub const STATUS_ERROR: u32 = 0xf87171;
636 pub const STATUS_WARNING: u32 = 0xfbbf24;
637 pub const STATUS_SUCCESS: u32 = 0x6ee7b7;
638 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
639 pub const DROP_REFUSE: u32 = 0x7c2440;
640
641 // -- subtitles --------------------------------------------------------------
642 pub const SUB_FG: u32 = 0xffffff;
643 pub const SUB_SHADE: u32 = 0x000000cc;
644
645 // -- the equalizer graph and the histogram ----------------------------------
646 pub const EQ_GRID: u32 = 0x2e3150;
647 pub const EQ_SPECTRUM_INK: u32 = 0xb6b4d866;
648 pub const EQ_FILL_INK: u32 = 0xa78bfa26;
649 pub const EQ_BELL_INK: u32 = 0xa78bfa66;
650 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
651 // -- Darkroom token substrate: aliased onto this family's nearest role -----
652 pub const INK1: u32 = FG_PRIMARY;
653 pub const INK2: u32 = FG_SECONDARY;
654 pub const INK3: u32 = FG_DISABLED;
655 pub const INK4: u32 = FG_DISABLED;
656 pub const DARK_CANVAS: u32 = BG_CANVAS;
657 pub const DARK_PANEL: u32 = BG_PANEL;
658 pub const DARK_RAISED: u32 = BG_RAISED;
659 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
660 pub const DARK_SEAM: u32 = SCRIM;
661 pub const LAMP_WHITE: u32 = 0xffffff;
662 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
663 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
664 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
665 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
666 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
667}
668
669/// Family E: a ground with no cast at all -- the neutral one, for grading, where
670/// nothing but the accent has a hue. That accent is rose, and the playhead is
671/// the cyan on the other side of the wheel from it.
672pub mod rose {
673 // -- surfaces ---------------------------------------------------------------
674 pub const BG_CANVAS: u32 = 0x0c0b0c;
675 pub const BG_PANEL: u32 = 0x1a181a;
676 pub const BG_RAISED: u32 = 0x2a272a;
677 pub const BG_TIMELINE: u32 = 0x121012;
678 pub const BG_HOVER: u32 = 0x3d383d;
679 pub const BG_HOVER_DIM: u32 = 0x221f22;
680 pub const BG_SELECTED: u32 = 0x6b1f38;
681 pub const SCRIM: u32 = 0x0c0b0ccc;
682 pub const SCRIM_LIGHT: u32 = 0x0c0b0c55;
683
684 // -- strokes ----------------------------------------------------------------
685 pub const STROKE_DIVIDER: u32 = 0x332f33;
686 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
687
688 // -- text -------------------------------------------------------------------
689 pub const FG_PRIMARY: u32 = 0xf3edef;
690 pub const FG_SECONDARY: u32 = 0xc0b4b8;
691 pub const FG_DISABLED: u32 = 0x8a7e82;
692
693 // -- interaction ------------------------------------------------------------
694 pub const ACCENT_PRIMARY: u32 = 0xfb7185;
695 pub const ACCENT_HOVER: u32 = 0xfda4af;
696 pub const ACCENT_PLAYHEAD: u32 = 0x67e8f9;
697 pub const ACCENT_WASH: u32 = 0xfb7185aa;
698
699 // -- clip kinds -------------------------------------------------------------
700 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
701 pub const CLIP_AUDIO: u32 = 0x2c6b49;
702 pub const CLIP_IMAGE: u32 = 0x1c6270;
703 pub const CLIP_TEXT: u32 = 0x6b46c1;
704
705 pub const SOURCE_TINTS: [u32; 12] = [
706 0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8, 0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8, 0xe87f97,
707 0x7fc8e8, 0xe8c87f, 0x9b7fe8,
708 ];
709
710 // -- feedback ---------------------------------------------------------------
711 /// Brighter and more saturated than the accent it sits near on the wheel: on
712 /// a rose window a failure has to be louder than "this is live", and the
713 /// message's own first word says which it is either way ([`super::notice_tone`]).
714 pub const STATUS_ERROR: u32 = 0xff4d4d;
715 pub const STATUS_WARNING: u32 = 0xfacc15;
716 pub const STATUS_SUCCESS: u32 = 0x4ade80;
717 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
718 pub const DROP_REFUSE: u32 = 0x8f2740;
719
720 // -- subtitles --------------------------------------------------------------
721 pub const SUB_FG: u32 = 0xffffff;
722 pub const SUB_SHADE: u32 = 0x000000cc;
723
724 // -- the equalizer graph and the histogram ----------------------------------
725 pub const EQ_GRID: u32 = 0x332f33;
726 pub const EQ_SPECTRUM_INK: u32 = 0xc0b4b866;
727 pub const EQ_FILL_INK: u32 = 0xfb718526;
728 pub const EQ_BELL_INK: u32 = 0xfb718566;
729 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
730 // -- Darkroom token substrate: aliased onto this family's nearest role -----
731 pub const INK1: u32 = FG_PRIMARY;
732 pub const INK2: u32 = FG_SECONDARY;
733 pub const INK3: u32 = FG_DISABLED;
734 pub const INK4: u32 = FG_DISABLED;
735 pub const DARK_CANVAS: u32 = BG_CANVAS;
736 pub const DARK_PANEL: u32 = BG_PANEL;
737 pub const DARK_RAISED: u32 = BG_RAISED;
738 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
739 pub const DARK_SEAM: u32 = SCRIM;
740 pub const LAMP_WHITE: u32 = 0xffffff;
741 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
742 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
743 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
744 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
745 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
746}
747
748/// Family F: a graphite ground -- neutral, a touch warm -- under one gold
749/// accent.
750pub mod amber {
751 // -- surfaces ---------------------------------------------------------------
752 pub const BG_CANVAS: u32 = 0x0d0d0c;
753 pub const BG_PANEL: u32 = 0x1b1b19;
754 pub const BG_RAISED: u32 = 0x2b2b27;
755 pub const BG_TIMELINE: u32 = 0x131311;
756 pub const BG_HOVER: u32 = 0x3e3e38;
757 pub const BG_HOVER_DIM: u32 = 0x232320;
758 /// Gold at surface brightness carries neither ink at 4.5:1, so the picked
759 /// row is the accent taken down to a bronze.
760 pub const BG_SELECTED: u32 = 0x5e3a0b;
761 pub const SCRIM: u32 = 0x0d0d0ccc;
762 pub const SCRIM_LIGHT: u32 = 0x0d0d0c55;
763
764 // -- strokes ----------------------------------------------------------------
765 pub const STROKE_DIVIDER: u32 = 0x35352f;
766 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
767
768 // -- text -------------------------------------------------------------------
769 pub const FG_PRIMARY: u32 = 0xf2f0e9;
770 pub const FG_SECONDARY: u32 = 0xbdbaae;
771 pub const FG_DISABLED: u32 = 0x87857c;
772
773 // -- interaction ------------------------------------------------------------
774 pub const ACCENT_PRIMARY: u32 = 0xfbbf24;
775 pub const ACCENT_HOVER: u32 = 0xfcd34d;
776 pub const ACCENT_PLAYHEAD: u32 = 0x93c5fd;
777 pub const ACCENT_WASH: u32 = 0xfbbf24aa;
778
779 // -- clip kinds -------------------------------------------------------------
780 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
781 pub const CLIP_AUDIO: u32 = 0x2c6b49;
782 pub const CLIP_IMAGE: u32 = 0x1c6270;
783 pub const CLIP_TEXT: u32 = 0x6b46c1;
784
785 pub const SOURCE_TINTS: [u32; 12] = [
786 0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1, 0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1, 0xe8b45f,
787 0x5fa8e8, 0x7fd69b, 0xd68fc1,
788 ];
789
790 // -- feedback ---------------------------------------------------------------
791 /// The warning steps to orange: amber *is* the accent here, and a warning
792 /// wearing it would be indistinguishable from every live control.
793 pub const STATUS_ERROR: u32 = 0xf05252;
794 pub const STATUS_WARNING: u32 = 0xfb923c;
795 pub const STATUS_SUCCESS: u32 = 0x4ade80;
796 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
797 pub const DROP_REFUSE: u32 = 0x7a2f24;
798
799 // -- subtitles --------------------------------------------------------------
800 pub const SUB_FG: u32 = 0xffffff;
801 pub const SUB_SHADE: u32 = 0x000000cc;
802
803 // -- the equalizer graph and the histogram ----------------------------------
804 pub const EQ_GRID: u32 = 0x35352f;
805 pub const EQ_SPECTRUM_INK: u32 = 0xbdbaae66;
806 pub const EQ_FILL_INK: u32 = 0xfbbf2426;
807 pub const EQ_BELL_INK: u32 = 0xfbbf2466;
808 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
809 // -- Darkroom token substrate: aliased onto this family's nearest role -----
810 pub const INK1: u32 = FG_PRIMARY;
811 pub const INK2: u32 = FG_SECONDARY;
812 pub const INK3: u32 = FG_DISABLED;
813 pub const INK4: u32 = FG_DISABLED;
814 pub const DARK_CANVAS: u32 = BG_CANVAS;
815 pub const DARK_PANEL: u32 = BG_PANEL;
816 pub const DARK_RAISED: u32 = BG_RAISED;
817 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
818 pub const DARK_SEAM: u32 = SCRIM;
819 pub const LAMP_WHITE: u32 = 0xffffff;
820 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
821 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
822 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
823 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
824 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
825}
826
827/// Family G: a blue-black ground -- deeper and bluer than `cool`'s neutral --
828/// under one azure accent. Where `cool` is a grey that leans cold, this one is
829/// water: the panels themselves carry the hue and the accent is the light on it.
830pub mod ocean {
831 // -- surfaces ---------------------------------------------------------------
832 pub const BG_CANVAS: u32 = 0x05080f;
833 pub const BG_PANEL: u32 = 0x0d1524;
834 pub const BG_RAISED: u32 = 0x172436;
835 pub const BG_TIMELINE: u32 = 0x08101c;
836 pub const BG_HOVER: u32 = 0x223449;
837 pub const BG_HOVER_DIM: u32 = 0x14202f;
838 pub const BG_SELECTED: u32 = 0x0f3a6b;
839 pub const SCRIM: u32 = 0x05080fcc;
840 pub const SCRIM_LIGHT: u32 = 0x05080f55;
841
842 // -- strokes ----------------------------------------------------------------
843 pub const STROKE_DIVIDER: u32 = 0x1e2d42;
844 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
845
846 // -- text -------------------------------------------------------------------
847 pub const FG_PRIMARY: u32 = 0xe6eefb;
848 pub const FG_SECONDARY: u32 = 0xa4bcd8;
849 pub const FG_DISABLED: u32 = 0x6b8199;
850
851 // -- interaction ------------------------------------------------------------
852 pub const ACCENT_PRIMARY: u32 = 0x38bdf8;
853 pub const ACCENT_HOVER: u32 = 0x7dd3fc;
854 pub const ACCENT_PLAYHEAD: u32 = 0xff9db0;
855 pub const ACCENT_WASH: u32 = 0x38bdf8aa;
856
857 // -- clip kinds -------------------------------------------------------------
858 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
859 pub const CLIP_AUDIO: u32 = 0x2c6b49;
860 pub const CLIP_IMAGE: u32 = 0x1c6270;
861 pub const CLIP_TEXT: u32 = 0x6b46c1;
862
863 pub const SOURCE_TINTS: [u32; 12] = [
864 0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8, 0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8, 0x5fa8e8,
865 0xe8a95f, 0x5fd6a0, 0xc98fe8,
866 ];
867
868 // -- feedback ---------------------------------------------------------------
869 pub const STATUS_ERROR: u32 = 0xf05252;
870 pub const STATUS_WARNING: u32 = 0xfbbf24;
871 pub const STATUS_SUCCESS: u32 = 0x4ade80;
872 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
873 pub const DROP_REFUSE: u32 = 0x8a2740;
874
875 // -- subtitles --------------------------------------------------------------
876 pub const SUB_FG: u32 = 0xffffff;
877 pub const SUB_SHADE: u32 = 0x000000cc;
878
879 // -- the equalizer graph and the histogram ----------------------------------
880 pub const EQ_GRID: u32 = 0x1e2d42;
881 pub const EQ_SPECTRUM_INK: u32 = 0xa4bcd866;
882 pub const EQ_FILL_INK: u32 = 0x38bdf826;
883 pub const EQ_BELL_INK: u32 = 0x38bdf866;
884 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
885 // -- Darkroom token substrate: aliased onto this family's nearest role -----
886 pub const INK1: u32 = FG_PRIMARY;
887 pub const INK2: u32 = FG_SECONDARY;
888 pub const INK3: u32 = FG_DISABLED;
889 pub const INK4: u32 = FG_DISABLED;
890 pub const DARK_CANVAS: u32 = BG_CANVAS;
891 pub const DARK_PANEL: u32 = BG_PANEL;
892 pub const DARK_RAISED: u32 = BG_RAISED;
893 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
894 pub const DARK_SEAM: u32 = SCRIM;
895 pub const LAMP_WHITE: u32 = 0xffffff;
896 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
897 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
898 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
899 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
900 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
901}
902
903/// Family H: the crisp one. A near-black blue ground with the widest ink range
904/// in the set -- the primary text is nearly white and the canvas nearly black --
905/// under a pale ice-blue accent, for the long grade where every other family
906/// starts to read as soft.
907pub mod ice {
908 // -- surfaces ---------------------------------------------------------------
909 pub const BG_CANVAS: u32 = 0x03060a;
910 pub const BG_PANEL: u32 = 0x0b131c;
911 pub const BG_RAISED: u32 = 0x18232f;
912 pub const BG_TIMELINE: u32 = 0x060d15;
913 pub const BG_HOVER: u32 = 0x24323f;
914 pub const BG_HOVER_DIM: u32 = 0x121c26;
915 /// A steel blue rather than the accent: ice at surface brightness is nearly
916 /// white and would carry no ink at all (WCAG 1.4.3).
917 pub const BG_SELECTED: u32 = 0x14476b;
918 pub const SCRIM: u32 = 0x03060acc;
919 pub const SCRIM_LIGHT: u32 = 0x03060a55;
920
921 // -- strokes ----------------------------------------------------------------
922 pub const STROKE_DIVIDER: u32 = 0x223140;
923 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
924
925 // -- text -------------------------------------------------------------------
926 pub const FG_PRIMARY: u32 = 0xf4fafe;
927 pub const FG_SECONDARY: u32 = 0xb8cfe0;
928 pub const FG_DISABLED: u32 = 0x71889b;
929
930 // -- interaction ------------------------------------------------------------
931 pub const ACCENT_PRIMARY: u32 = 0xa5f3fc;
932 pub const ACCENT_HOVER: u32 = 0xcffafe;
933 pub const ACCENT_PLAYHEAD: u32 = 0xff8fa3;
934 pub const ACCENT_WASH: u32 = 0xa5f3fcaa;
935
936 // -- clip kinds -------------------------------------------------------------
937 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
938 pub const CLIP_AUDIO: u32 = 0x2c6b49;
939 pub const CLIP_IMAGE: u32 = 0x1c6270;
940 pub const CLIP_TEXT: u32 = 0x6b46c1;
941
942 pub const SOURCE_TINTS: [u32; 12] = [
943 0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8, 0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8, 0x7fd6e8,
944 0xe8b47f, 0x8fd69b, 0xc79be8,
945 ];
946
947 // -- feedback ---------------------------------------------------------------
948 pub const STATUS_ERROR: u32 = 0xff6b6b;
949 pub const STATUS_WARNING: u32 = 0xfbbf24;
950 pub const STATUS_SUCCESS: u32 = 0x4ade80;
951 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
952 pub const DROP_REFUSE: u32 = 0x8f2740;
953
954 // -- subtitles --------------------------------------------------------------
955 pub const SUB_FG: u32 = 0xffffff;
956 pub const SUB_SHADE: u32 = 0x000000cc;
957
958 // -- the equalizer graph and the histogram ----------------------------------
959 pub const EQ_GRID: u32 = 0x223140;
960 pub const EQ_SPECTRUM_INK: u32 = 0xb8cfe066;
961 pub const EQ_FILL_INK: u32 = 0xa5f3fc26;
962 pub const EQ_BELL_INK: u32 = 0xa5f3fc66;
963 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
964 // -- Darkroom token substrate: aliased onto this family's nearest role -----
965 pub const INK1: u32 = FG_PRIMARY;
966 pub const INK2: u32 = FG_SECONDARY;
967 pub const INK3: u32 = FG_DISABLED;
968 pub const INK4: u32 = FG_DISABLED;
969 pub const DARK_CANVAS: u32 = BG_CANVAS;
970 pub const DARK_PANEL: u32 = BG_PANEL;
971 pub const DARK_RAISED: u32 = BG_RAISED;
972 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
973 pub const DARK_SEAM: u32 = SCRIM;
974 pub const LAMP_WHITE: u32 = 0xffffff;
975 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
976 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
977 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
978 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
979 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
980}
981
982/// Family I: a dark plum ground under one orchid accent -- the warm end of the
983/// purples, where `violet` is the cold one. The text clip is pushed towards
984/// indigo here for `violet`'s reason: a text clip and "press this" may not be
985/// the same purple.
986pub mod orchid {
987 // -- surfaces ---------------------------------------------------------------
988 pub const BG_CANVAS: u32 = 0x0c0712;
989 pub const BG_PANEL: u32 = 0x1a0f24;
990 pub const BG_RAISED: u32 = 0x2a1a38;
991 pub const BG_TIMELINE: u32 = 0x120a19;
992 pub const BG_HOVER: u32 = 0x3b2650;
993 pub const BG_HOVER_DIM: u32 = 0x231530;
994 pub const BG_SELECTED: u32 = 0x6b1f5e;
995 pub const SCRIM: u32 = 0x0c0712cc;
996 pub const SCRIM_LIGHT: u32 = 0x0c071255;
997
998 // -- strokes ----------------------------------------------------------------
999 pub const STROKE_DIVIDER: u32 = 0x33203f;
1000 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
1001
1002 // -- text -------------------------------------------------------------------
1003 pub const FG_PRIMARY: u32 = 0xf6ecf8;
1004 pub const FG_SECONDARY: u32 = 0xc7b0cf;
1005 pub const FG_DISABLED: u32 = 0x8e7a97;
1006
1007 // -- interaction ------------------------------------------------------------
1008 pub const ACCENT_PRIMARY: u32 = 0xd946ef;
1009 pub const ACCENT_HOVER: u32 = 0xe879f9;
1010 pub const ACCENT_PLAYHEAD: u32 = 0xfbbf24;
1011 pub const ACCENT_WASH: u32 = 0xd946efaa;
1012
1013 // -- clip kinds -------------------------------------------------------------
1014 pub const CLIP_VIDEO: u32 = 0x2f5a9e;
1015 pub const CLIP_AUDIO: u32 = 0x2c6b49;
1016 pub const CLIP_IMAGE: u32 = 0x1c6270;
1017 pub const CLIP_TEXT: u32 = 0x5a45b8;
1018
1019 pub const SOURCE_TINTS: [u32; 12] = [
1020 0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4, 0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4, 0xe88fd6,
1021 0x8fc9e8, 0xe8c48f, 0x8fe8b4,
1022 ];
1023
1024 // -- feedback ---------------------------------------------------------------
1025 pub const STATUS_ERROR: u32 = 0xf87171;
1026 pub const STATUS_WARNING: u32 = 0xfb923c;
1027 pub const STATUS_SUCCESS: u32 = 0x4ade80;
1028 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1029 pub const DROP_REFUSE: u32 = 0x8f2740;
1030
1031 // -- subtitles --------------------------------------------------------------
1032 pub const SUB_FG: u32 = 0xffffff;
1033 pub const SUB_SHADE: u32 = 0x000000cc;
1034
1035 // -- the equalizer graph and the histogram ----------------------------------
1036 pub const EQ_GRID: u32 = 0x33203f;
1037 pub const EQ_SPECTRUM_INK: u32 = 0xc7b0cf66;
1038 pub const EQ_FILL_INK: u32 = 0xd946ef26;
1039 pub const EQ_BELL_INK: u32 = 0xd946ef66;
1040 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1041 // -- Darkroom token substrate: aliased onto this family's nearest role -----
1042 pub const INK1: u32 = FG_PRIMARY;
1043 pub const INK2: u32 = FG_SECONDARY;
1044 pub const INK3: u32 = FG_DISABLED;
1045 pub const INK4: u32 = FG_DISABLED;
1046 pub const DARK_CANVAS: u32 = BG_CANVAS;
1047 pub const DARK_PANEL: u32 = BG_PANEL;
1048 pub const DARK_RAISED: u32 = BG_RAISED;
1049 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1050 pub const DARK_SEAM: u32 = SCRIM;
1051 pub const LAMP_WHITE: u32 = 0xffffff;
1052 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1053 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1054 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1055 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1056 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
1057}
1058
1059/// Family J: Nord, the arctic palette (arcticicestudio/nord, MIT) -- Polar
1060/// Night for the surfaces, Snow Storm for the ink, Frost for the accent, Aurora
1061/// for everything that has to mean something. Its own numbers wherever they
1062/// clear the floors: `nord0`..`nord3` are the panels verbatim, and the canvas
1063/// and the lane bed are taken one step below `nord0`, which the set does not
1064/// name, because a bed lighter than its panel stops reading as a hole.
1065///
1066/// The clip bodies and the dim ink are the adapted ones. Aurora is a *text*
1067/// palette: `nord14` green under white is 2.6:1, and this editor draws a name
1068/// and a waveform on every clip body, so the four kinds are those hues taken
1069/// down to where WCAG 1.4.3 holds.
1070pub mod nord {
1071 // -- surfaces ---------------------------------------------------------------
1072 pub const BG_CANVAS: u32 = 0x21262e;
1073 pub const BG_PANEL: u32 = 0x2e3440;
1074 pub const BG_RAISED: u32 = 0x3b4252;
1075 pub const BG_TIMELINE: u32 = 0x272c36;
1076 pub const BG_HOVER: u32 = 0x434c5e;
1077 pub const BG_HOVER_DIM: u32 = 0x353c4a;
1078 /// `nord10` is Nord's own picked row and carries the dim ink at 2.9:1, so
1079 /// the row is that blue taken down until 4.5:1 holds (WCAG 1.4.3).
1080 pub const BG_SELECTED: u32 = 0x2e4a6e;
1081 pub const SCRIM: u32 = 0x21262ecc;
1082 pub const SCRIM_LIGHT: u32 = 0x21262e55;
1083
1084 // -- strokes ----------------------------------------------------------------
1085 pub const STROKE_DIVIDER: u32 = 0x434c5e;
1086 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
1087
1088 // -- text -------------------------------------------------------------------
1089 pub const FG_PRIMARY: u32 = 0xeceff4;
1090 pub const FG_SECONDARY: u32 = 0xd8dee9;
1091 /// Lighter than `nord3`, which is a *surface* in Nord and only 2.6:1 on the
1092 /// raised one: dimmed text still has to be read (WCAG 1.4.11).
1093 pub const FG_DISABLED: u32 = 0x8a94a8;
1094
1095 // -- interaction ------------------------------------------------------------
1096 pub const ACCENT_PRIMARY: u32 = 0x88c0d0;
1097 pub const ACCENT_HOVER: u32 = 0x8fbcbb;
1098 /// `nord13`. Orange (`nord12`) is the obvious playhead and is 2.3:1 on a
1099 /// video clip -- the line has to be findable on every body it crosses.
1100 pub const ACCENT_PLAYHEAD: u32 = 0xebcb8b;
1101 pub const ACCENT_WASH: u32 = 0x88c0d0aa;
1102
1103 // -- clip kinds (Aurora, taken down to where a name is legible on it) -------
1104 pub const CLIP_VIDEO: u32 = 0x3b5f8a;
1105 pub const CLIP_AUDIO: u32 = 0x4d6b3f;
1106 pub const CLIP_IMAGE: u32 = 0x3f6a69;
1107 pub const CLIP_TEXT: u32 = 0x6b4a78;
1108
1109 /// Aurora and Frost at full strength: a swatch carries no text, so these are
1110 /// Nord's own numbers.
1111 pub const SOURCE_TINTS: [u32; 12] = [
1112 0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead, 0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead, 0x88c0d0,
1113 0xd08770, 0xa3be8c, 0xb48ead,
1114 ];
1115
1116 // -- feedback ---------------------------------------------------------------
1117 pub const STATUS_ERROR: u32 = 0xbf616a;
1118 pub const STATUS_WARNING: u32 = 0xd08770;
1119 pub const STATUS_SUCCESS: u32 = 0xa3be8c;
1120 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1121 pub const DROP_REFUSE: u32 = 0x7a3038;
1122
1123 // -- subtitles --------------------------------------------------------------
1124 pub const SUB_FG: u32 = 0xffffff;
1125 pub const SUB_SHADE: u32 = 0x000000cc;
1126
1127 // -- the equalizer graph and the histogram ----------------------------------
1128 pub const EQ_GRID: u32 = 0x434c5e;
1129 pub const EQ_SPECTRUM_INK: u32 = 0xd8dee966;
1130 pub const EQ_FILL_INK: u32 = 0x88c0d026;
1131 pub const EQ_BELL_INK: u32 = 0x88c0d066;
1132 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1133 // -- Darkroom token substrate: aliased onto this family's nearest role -----
1134 pub const INK1: u32 = FG_PRIMARY;
1135 pub const INK2: u32 = FG_SECONDARY;
1136 pub const INK3: u32 = FG_DISABLED;
1137 pub const INK4: u32 = FG_DISABLED;
1138 pub const DARK_CANVAS: u32 = BG_CANVAS;
1139 pub const DARK_PANEL: u32 = BG_PANEL;
1140 pub const DARK_RAISED: u32 = BG_RAISED;
1141 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1142 pub const DARK_SEAM: u32 = SCRIM;
1143 pub const LAMP_WHITE: u32 = 0xffffff;
1144 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1145 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1146 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1147 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1148 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
1149}
1150
1151/// Family K: Gruvbox dark (morhetz/gruvbox, MIT) -- the retro brown-grey ground
1152/// and the warm ink that made it, under its own orange. `bg0_h`, `bg0`, `bg1`
1153/// and `bg2` are the surfaces verbatim and `fg1`..`fg4` the ink; the clip bodies
1154/// are the neutral-mode hues taken down for the same reason Nord's are.
1155///
1156/// Two of its colours do two jobs here rather than one: orange is the accent
1157/// and green the playhead -- so the family is recognisable from the chrome and
1158/// not only from the ground.
1159pub mod gruvbox {
1160 // -- surfaces ---------------------------------------------------------------
1161 pub const BG_CANVAS: u32 = 0x1d2021;
1162 pub const BG_PANEL: u32 = 0x282828;
1163 pub const BG_RAISED: u32 = 0x3c3836;
1164 pub const BG_TIMELINE: u32 = 0x232323;
1165 pub const BG_HOVER: u32 = 0x504945;
1166 pub const BG_HOVER_DIM: u32 = 0x32302f;
1167 /// The orange taken to where `fg2` clears 4.5:1 on it -- `bg2`, gruvbox's
1168 /// own selection, is a grey and says nothing about which row is picked.
1169 pub const BG_SELECTED: u32 = 0x7c3f12;
1170 pub const SCRIM: u32 = 0x1d2021cc;
1171 pub const SCRIM_LIGHT: u32 = 0x1d202155;
1172
1173 // -- strokes ----------------------------------------------------------------
1174 pub const STROKE_DIVIDER: u32 = 0x504945;
1175 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
1176
1177 // -- text -------------------------------------------------------------------
1178 pub const FG_PRIMARY: u32 = 0xebdbb2;
1179 pub const FG_SECONDARY: u32 = 0xd5c4a1;
1180 pub const FG_DISABLED: u32 = 0xa89984;
1181
1182 // -- interaction ------------------------------------------------------------
1183 pub const ACCENT_PRIMARY: u32 = 0xfe8019;
1184 pub const ACCENT_HOVER: u32 = 0xfabd2f;
1185 /// Bright green: it is the one gruvbox hue that clears 3:1 on all four clip
1186 /// bodies at once, which is what a line crossing every one of them owes.
1187 pub const ACCENT_PLAYHEAD: u32 = 0xb8bb26;
1188 pub const ACCENT_WASH: u32 = 0xfe8019aa;
1189
1190 // -- clip kinds -------------------------------------------------------------
1191 pub const CLIP_VIDEO: u32 = 0x35657e;
1192 pub const CLIP_AUDIO: u32 = 0x4b661c;
1193 pub const CLIP_IMAGE: u32 = 0x2f6a63;
1194 pub const CLIP_TEXT: u32 = 0x7a4a72;
1195
1196 pub const SOURCE_TINTS: [u32; 12] = [
1197 0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b, 0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b, 0xfe8019,
1198 0x83a598, 0xb8bb26, 0xd3869b,
1199 ];
1200
1201 // -- feedback ---------------------------------------------------------------
1202 pub const STATUS_ERROR: u32 = 0xfb4934;
1203 pub const STATUS_WARNING: u32 = 0xfabd2f;
1204 pub const STATUS_SUCCESS: u32 = 0x8ec07c;
1205 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1206 pub const DROP_REFUSE: u32 = 0x9d0006;
1207
1208 // -- subtitles --------------------------------------------------------------
1209 pub const SUB_FG: u32 = 0xffffff;
1210 pub const SUB_SHADE: u32 = 0x000000cc;
1211
1212 // -- the equalizer graph and the histogram ----------------------------------
1213 pub const EQ_GRID: u32 = 0x504945;
1214 pub const EQ_SPECTRUM_INK: u32 = 0xd5c4a166;
1215 pub const EQ_FILL_INK: u32 = 0xfe801926;
1216 pub const EQ_BELL_INK: u32 = 0xfe801966;
1217 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1218 // -- Darkroom token substrate: aliased onto this family's nearest role -----
1219 pub const INK1: u32 = FG_PRIMARY;
1220 pub const INK2: u32 = FG_SECONDARY;
1221 pub const INK3: u32 = FG_DISABLED;
1222 pub const INK4: u32 = FG_DISABLED;
1223 pub const DARK_CANVAS: u32 = BG_CANVAS;
1224 pub const DARK_PANEL: u32 = BG_PANEL;
1225 pub const DARK_RAISED: u32 = BG_RAISED;
1226 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1227 pub const DARK_SEAM: u32 = SCRIM;
1228 pub const LAMP_WHITE: u32 = 0xffffff;
1229 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1230 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1231 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1232 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1233 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
1234}
1235
1236/// Family L: Dracula (dracula/dracula-theme, MIT) -- its background, current
1237/// line and foreground verbatim, and its pink for the accent rather than the
1238/// purple, which `violet` already sits on. Comment (`#6272a4`) is Dracula's dim
1239/// ink and measures 2.4:1 on the raised surface, so the dim ink here is lifted
1240/// and the comment blue is what a *disabled* control wears.
1241pub mod dracula {
1242 // -- surfaces ---------------------------------------------------------------
1243 pub const BG_CANVAS: u32 = 0x1e1f29;
1244 pub const BG_PANEL: u32 = 0x282a36;
1245 pub const BG_RAISED: u32 = 0x343746;
1246 pub const BG_TIMELINE: u32 = 0x22232e;
1247 pub const BG_HOVER: u32 = 0x44475a;
1248 pub const BG_HOVER_DIM: u32 = 0x2f3141;
1249 pub const BG_SELECTED: u32 = 0x6b2a70;
1250 pub const SCRIM: u32 = 0x1e1f29cc;
1251 pub const SCRIM_LIGHT: u32 = 0x1e1f2955;
1252
1253 // -- strokes ----------------------------------------------------------------
1254 pub const STROKE_DIVIDER: u32 = 0x44475a;
1255 pub const STROKE_SELECTED: u32 = ACCENT_PRIMARY;
1256
1257 // -- text -------------------------------------------------------------------
1258 pub const FG_PRIMARY: u32 = 0xf8f8f2;
1259 pub const FG_SECONDARY: u32 = 0xc3c5d8;
1260 pub const FG_DISABLED: u32 = 0x7b8bc4;
1261
1262 // -- interaction ------------------------------------------------------------
1263 pub const ACCENT_PRIMARY: u32 = 0xff79c6;
1264 pub const ACCENT_HOVER: u32 = 0xff92d0;
1265 pub const ACCENT_PLAYHEAD: u32 = 0xf1fa8c;
1266 pub const ACCENT_WASH: u32 = 0xff79c6aa;
1267
1268 // -- clip kinds -------------------------------------------------------------
1269 pub const CLIP_VIDEO: u32 = 0x3f5aa6;
1270 pub const CLIP_AUDIO: u32 = 0x2f7a48;
1271 pub const CLIP_IMAGE: u32 = 0x2b6e78;
1272 pub const CLIP_TEXT: u32 = 0x6a3fb0;
1273
1274 /// Dracula's own six, four of them: a swatch carries no text.
1275 pub const SOURCE_TINTS: [u32; 12] = [
1276 0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c, 0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c, 0xff79c6,
1277 0x8be9fd, 0x50fa7b, 0xffb86c,
1278 ];
1279
1280 // -- feedback ---------------------------------------------------------------
1281 pub const STATUS_ERROR: u32 = 0xff5555;
1282 pub const STATUS_WARNING: u32 = 0xffb86c;
1283 pub const STATUS_SUCCESS: u32 = 0x50fa7b;
1284 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1285 pub const DROP_REFUSE: u32 = 0x8f2a3a;
1286
1287 // -- subtitles --------------------------------------------------------------
1288 pub const SUB_FG: u32 = 0xffffff;
1289 pub const SUB_SHADE: u32 = 0x000000cc;
1290
1291 // -- the equalizer graph and the histogram ----------------------------------
1292 pub const EQ_GRID: u32 = 0x44475a;
1293 pub const EQ_SPECTRUM_INK: u32 = 0xc3c5d866;
1294 pub const EQ_FILL_INK: u32 = 0xff79c626;
1295 pub const EQ_BELL_INK: u32 = 0xff79c666;
1296 pub const HIST_INK: [u32; 3] = [0xE0_5A_5A, 0x5A_D0_7A, 0x5A_9A_E0];
1297 // -- Darkroom token substrate: aliased onto this family's nearest role -----
1298 pub const INK1: u32 = FG_PRIMARY;
1299 pub const INK2: u32 = FG_SECONDARY;
1300 pub const INK3: u32 = FG_DISABLED;
1301 pub const INK4: u32 = FG_DISABLED;
1302 pub const DARK_CANVAS: u32 = BG_CANVAS;
1303 pub const DARK_PANEL: u32 = BG_PANEL;
1304 pub const DARK_RAISED: u32 = BG_RAISED;
1305 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1306 pub const DARK_SEAM: u32 = SCRIM;
1307 pub const LAMP_WHITE: u32 = 0xffffff;
1308 pub const NOTICE_TELL: u32 = STATUS_SUCCESS;
1309 pub const NOTICE_LOOK: u32 = STATUS_WARNING;
1310 pub const NOTICE_DECIDE: u32 = STATUS_ERROR;
1311 pub const SAFELIGHT_GROUND: u32 = BG_CANVAS;
1312 pub const SAFELIGHT_GLYPH: u32 = ACCENT_PRIMARY;
1313}
1314
1315/// Family M: Darkroom (DESIGN.md §2) -- the thirteenth family and the room the
1316/// redesign is named after. Chrome is achromatic: every pre-existing role below
1317/// is a grey, distinguished by luminance rather than hue ("loudness is
1318/// luminance"); the only colour anywhere in this family sits on the roles
1319/// DESIGN.md actually gives one -- the amber safelight glyph and the two loud
1320/// notice tones. Everything else is the token substrate itself, taken verbatim
1321/// from the spec table.
1322pub mod darkroom {
1323 // -- surfaces -----------------------------------------------------------
1324 pub const BG_CANVAS: u32 = 0x050607;
1325 pub const BG_PANEL: u32 = 0x0e1013;
1326 // DESIGN §2's `raised` band (#14171B - #17191D) is the WHOLE interaction
1327 // ladder in this room: a resting raised fill, one step up for hover, one
1328 // more for a picked row -- selection's real mark is the 1px `ink1` ring
1329 // (§4), never a pale flood.
1330 //
1331 // These four used to carry the legacy tree's greys (hover #2A2E33,
1332 // selected #2E3237 -- two and three steps outside the band). Every
1333 // surface that paints a *role* rather than a Darkroom token -- the clip
1334 // menu, the library row menu, the keys overlay, the seven param cards --
1335 // read them, so each one opened a pale plate in a dim room while the
1336 // handful of surfaces written against `DARK_*`/`INK*` directly looked
1337 // right. That is the whole "some menus belong to old ui" class, and it
1338 // is fixed here, once, rather than by another per-call-site `if
1339 // darkroom` branch: role tokens ARE the theme's job (§2's guard).
1340 pub const BG_RAISED: u32 = 0x14171b;
1341 pub const BG_TIMELINE: u32 = 0x08090b;
1342 pub const BG_HOVER: u32 = 0x17191d;
1343 pub const BG_HOVER_DIM: u32 = 0x121418;
1344 pub const BG_SELECTED: u32 = 0x1c1f24;
1345 pub const SCRIM: u32 = 0x050607cc;
1346 pub const SCRIM_LIGHT: u32 = 0x05060755;
1347
1348 // -- strokes --------------------------------------------------------------
1349 pub const STROKE_DIVIDER: u32 = 0x22262b;
1350 /// "Focus/selection ring = 1px ink1 (lamp-adjacent, not coloured)."
1351 pub const STROKE_SELECTED: u32 = INK1;
1352
1353 // -- text -------------------------------------------------------------------
1354 pub const FG_PRIMARY: u32 = INK1;
1355 pub const FG_SECONDARY: u32 = INK2;
1356 pub const FG_DISABLED: u32 = INK4;
1357
1358 // -- interaction --------------------------------------------------------
1359 pub const ACCENT_PRIMARY: u32 = INK2;
1360 pub const ACCENT_HOVER: u32 = INK1;
1361 pub const ACCENT_PLAYHEAD: u32 = LAMP_WHITE;
1362 pub const ACCENT_WASH: u32 = 0x9ba3ac55;
1363
1364 // -- clip kinds (luminance steps, no hue -- held under the grey that still
1365 // carries FG_SECONDARY at 3:1, WCAG 1.4.11) -------------------------------
1366 pub const CLIP_VIDEO: u32 = 0x343434;
1367 pub const CLIP_AUDIO: u32 = 0x3d3d3d;
1368 pub const CLIP_IMAGE: u32 = 0x464646;
1369 pub const CLIP_TEXT: u32 = 0x4f4f4f;
1370
1371 // DESIGN §2 reference extraction, S/L clamped into the WCAG band and
1372 // walked around the wheel at 12 stops (30° apart) so the cap in the same
1373 // paragraph has one real value per hue rather than four greys repeated:
1374 // azure #64B5D1, magenta #D164B5, green #64D19A, violet #7F64D1, teal
1375 // #64D1D1 sit at indices 0, 4, 9(~), 2(~), 5(~) of this wheel.
1376 // hook: §12 step 5 -- real per-source extraction replaces this constant
1377 // wheel with a quantized dominant hue per import; until then the index
1378 // is `source % 12`, which still guarantees different sources differ.
1379 pub const SOURCE_TINTS: [u32; 12] = [
1380 0x64b5d1, 0x647ed1, 0x8064d1, 0xb664d1, 0xd164b5, 0xd1647e, 0xd18064, 0xd1b764, 0xb5d164,
1381 0x7ed164, 0x64d180, 0x64d1b7,
1382 ];
1383
1384 // -- feedback -------------------------------------------------------------
1385 pub const STATUS_ERROR: u32 = NOTICE_DECIDE;
1386 pub const STATUS_WARNING: u32 = NOTICE_LOOK;
1387 pub const STATUS_SUCCESS: u32 = INK1;
1388 pub const STATUS_PROGRESS: u32 = ACCENT_PRIMARY;
1389 pub const DROP_REFUSE: u32 = NOTICE_DECIDE;
1390
1391 // -- subtitles --------------------------------------------------------------
1392 pub const SUB_FG: u32 = LAMP_WHITE;
1393 pub const SUB_SHADE: u32 = 0x000000cc;
1394
1395 // -- the equalizer graph and the histogram -------------------------------
1396 pub const EQ_GRID: u32 = 0x22262b;
1397 pub const EQ_SPECTRUM_INK: u32 = 0x9ba3ac66;
1398 pub const EQ_FILL_INK: u32 = 0x9ba3ac26;
1399 pub const EQ_BELL_INK: u32 = 0x9ba3ac66;
1400 pub const HIST_INK: [u32; 3] = [0x767e87, 0x9ba3ac, 0xc7cdd3];
1401
1402 // -- Darkroom token substrate (DESIGN.md §2, verbatim) -----------------------
1403 pub const INK1: u32 = 0xe6e9ec;
1404 pub const INK2: u32 = 0x9ba3ac;
1405 pub const INK3: u32 = 0x5e656d;
1406 pub const INK4: u32 = 0x3c4249;
1407 pub const DARK_CANVAS: u32 = BG_CANVAS;
1408 pub const DARK_PANEL: u32 = BG_PANEL;
1409 pub const DARK_RAISED: u32 = BG_RAISED;
1410 pub const DARK_HAIRLINE: u32 = STROKE_DIVIDER;
1411 /// Seam: `rgba(0,0,0,.7)`, encoded the way `SCRIM`/`SCRIM_LIGHT` are --
1412 /// `0xRRGGBBAA` -- so `0xb3` (179/255 ~= 0.702) is the closest byte to 70%.
1413 pub const DARK_SEAM: u32 = 0x000000b3;
1414 pub const LAMP_WHITE: u32 = 0xffffff;
1415 pub const NOTICE_TELL: u32 = 0x5e656d;
1416 pub const NOTICE_LOOK: u32 = 0xd1b564;
1417 pub const NOTICE_DECIDE: u32 = 0xc85050;
1418 pub const SAFELIGHT_GROUND: u32 = 0x0a0908;
1419 pub const SAFELIGHT_GLYPH: u32 = 0xff9d57;
1420}
1421
1422/// The box a button's glyph sits in, whatever the glyph happens to measure: the
1423/// pause bars are 12 px wide and the play triangle 11, and a button that resized
1424/// itself when it was pressed moved every button to its right.
1425pub const GLYPH_SLOT: f32 = 14.;
1426
1427/// How solid the shadow a drag draws is (`0xRRGGBBAA`): enough to read as a box,
1428/// little enough that the clip under it is still legible. Not a colour, so both
1429/// families share it.
1430pub const GHOST_ALPHA: u32 = 0x66;
1431
1432/// Which of the feedback colours a message wears. Read off the words rather
1433/// than carried alongside them: every message in this editor already opens with
1434/// what it is ("EXPORT DONE", "SCAN FAILED", "NOTHING DETACHED"), and a second
1435/// `tone` argument at seventy call sites is seventy chances to disagree with the
1436/// sentence it labels.
1437///
1438/// corner-cut: prefix matching, so a message worded outside these families reads
1439/// as neutral rather than wrong. Ceiling: a `Notice { text, tone }` struct the
1440/// day a message needs a colour its own words do not say.
1441pub fn notice_tone(message: &str) -> u32 {
1442 let has = |word: &str| message.contains(word);
1443 if has("FAILED") || has("ERROR") || has("REFUSED") || has("CANNOT") || has("COULD NOT") {
1444 STATUS_ERROR()
1445 } else if message.starts_with(crate::EXPORT_DONE) || has("SAVED") || has("DONE") {
1446 STATUS_SUCCESS()
1447 } else if has("NOTHING") || has("NO ") || has("EMPTY") {
1448 STATUS_WARNING()
1449 } else {
1450 ACCENT_PRIMARY()
1451 }
1452}
1453
1454// -- geometry the four regions are laid out on --------------------------------
1455/// Compact density: 11-13 px text, 28 px controls, 8 px gutters. The floor the
1456/// whole window is measured at is 640x360, and airy spacing loses a region.
1457pub const INSPECTOR_MIN_W: f32 = 208.;
1458pub const INSPECTOR_MAX_W: f32 = 320.;
1459pub const INSPECTOR_FRAC: f32 = 0.24;
1460
1461/// The inspector's width at this window width, on the library's own rule: a
1462/// share of the window, clamped so the picture keeps the middle at every size.
1463pub fn inspector_w(window_w: f32) -> f32 {
1464 (window_w * INSPECTOR_FRAC).clamp(INSPECTOR_MIN_W, INSPECTOR_MAX_W)
1465}