forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiB978e685Tahinli3 months ago627 commits

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