diff --git a/crates/app/src/keymap.rs b/crates/app/src/keymap.rs index 8637f4c..14c3cf8 100644 --- a/crates/app/src/keymap.rs +++ b/crates/app/src/keymap.rs @@ -143,6 +143,13 @@ actions! { /// track to that list places nothing -- the pair above it is what makes the /// timeline row a caption can land on. ImportSubtitles, + /// The dock's own `Add files` verb (MOCK-SPEC "Dock" IMPORT section): + /// the file chooser, same door [`crate::Player::pick_and_import`] and a + /// drop on the window already use. + AddFiles, + /// The dock's `Paste path` verb: imports whatever file the OS clipboard + /// names ([`crate::Player::paste_file_path`]). + PasteFilePath, ToggleMute, VolumeUp, VolumeDown, @@ -259,6 +266,8 @@ impl ActionId { ActionId::AddSubtitleLane => "Add a subtitle track", ActionId::RemoveSubtitleLane => "Remove the last subtitle track (it must be empty)", ActionId::ImportSubtitles => "Add subtitles from a file…", + ActionId::AddFiles => "Add files…", + ActionId::PasteFilePath => "Paste path (import the file it names)", ActionId::ToggleMute => "Mute / Unmute", ActionId::VolumeUp => "Volume up", ActionId::VolumeDown => "Volume down", @@ -335,6 +344,8 @@ impl ActionId { ActionId::AddSubtitleLane => "add-subtitle-lane", ActionId::RemoveSubtitleLane => "remove-subtitle-lane", ActionId::ImportSubtitles => "import-subtitles", + ActionId::AddFiles => "add-files", + ActionId::PasteFilePath => "paste-file-path", ActionId::ToggleMute => "toggle-mute", ActionId::VolumeUp => "volume-up", ActionId::VolumeDown => "volume-down", @@ -479,7 +490,11 @@ impl ActionId { // It writes a file like the three above it, and touches no edit // list -- what an export's own allow-list already means it stays // out of, not what puts it in this heading. - | ActionId::Screenshot => Category::File, + | ActionId::Screenshot + // The dock's import pair brings a file *in*, the same heading a + // file going *out* (Export, Save) already sits under. + | ActionId::AddFiles + | ActionId::PasteFilePath => Category::File, } } } @@ -1066,6 +1081,18 @@ impl Keymap { // track to the timeline, so it is not the bare "s": ctrl+i, the // i of import, free and next to nothing that deletes. b(ActionId::ImportSubtitles, "i", true), + // The dock's own import pair (MOCK-SPEC "Dock" IMPORT + // section). Add files takes the chord the mock draws, ^o + // (freed above): it is the burst-use command an editor + // reaches for constantly, where the setting it displaces is + // thrown once a project. Paste path stays off ^v -- that + // chord is the timeline's own Paste, asked for far more + // often while cutting than a clipboard path is pasted while + // importing -- and takes ctrl+l instead, the browser's own + // "go to this location" chord, which is what pasting a path + // to jump straight to a file already is. + b(ActionId::AddFiles, "o", true), + b(ActionId::PasteFilePath, "l", true), b(ActionId::ToggleMute, "m", false), // The unshifted pair, which is what gpui reports for those two // keys ("=" and "-", platform.rs:862): the volume keys every @@ -1123,11 +1150,13 @@ impl Keymap { // thrown once for a whole session rather than one wanted under // a hand -- the theme takes ctrl+h for that reason. b(ActionId::ToggleProxies, "p", true), - // Making them takes the key next to it, ctrl+o: the pair is one - // subject and the two chords are under the same finger, and - // every letter of the word itself is spoken for ("a" adds an - // audio lane, ctrl+a selects everything). - b(ActionId::ToggleAutoProxies, "o", true), + // ctrl+o moved to Add files (below, with `ImportSubtitles` -- + // display order follows [`ActionId::ALL`]) per DESIGN §11's + // frequency check: a burst-use import command over a + // once-a-project setting. The auto-proxy switch takes "m" + // instead, free and still a stand-in word ("make" -- what + // the switch decides is whether one gets made on import). + b(ActionId::ToggleAutoProxies, "m", true), // The theme takes ctrl+h -- the h of the word, since "t" is the // subtitles and ctrl+t takes one off -- and a ctrl chord because // it is a preference set once, not a stroke wanted under a hand @@ -1420,7 +1449,7 @@ mod tests { #[test] fn every_default_stroke_reaches_its_action() { let k = Keymap::defaults(); - assert_eq!(k.entries().len(), 71); + assert_eq!(k.entries().len(), 73); // The cut odometer: bare walks one, `<`/`>` (what shift+,/shift+. // actually type) strides ten. assert_eq!(k.lookup(".", false), Some(ActionId::WalkCutNext)); @@ -1435,7 +1464,9 @@ mod tests { assert_eq!(k.lookup("w", false), Some(ActionId::Screenshot)); assert_eq!(k.lookup("y", false), Some(ActionId::SubtitleStyle)); assert_eq!(k.lookup("p", true), Some(ActionId::ToggleProxies)); - assert_eq!(k.lookup("o", true), Some(ActionId::ToggleAutoProxies)); + assert_eq!(k.lookup("m", true), Some(ActionId::ToggleAutoProxies)); + assert_eq!(k.lookup("o", true), Some(ActionId::AddFiles)); + assert_eq!(k.lookup("l", true), Some(ActionId::PasteFilePath)); assert_eq!(k.lookup("?", false), Some(ActionId::ShowActions)); assert_eq!(k.lookup("h", true), Some(ActionId::Theme)); assert_eq!(k.lookup("space", false), Some(ActionId::Play)); diff --git a/crates/app/src/oracle.rs b/crates/app/src/oracle.rs index b0f9b29..61073ec 100644 --- a/crates/app/src/oracle.rs +++ b/crates/app/src/oracle.rs @@ -132,6 +132,11 @@ pub(crate) fn enable(action: ActionId, ctx: Ctx) -> Enable { // (`Player::pending_settings`), so refusing them before the first // file was refusing them exactly when they mean the most. | ActionId::Resolution + // The dock's import pair: how a first file gets in at all, so + // both are live with no timeline open, exactly like the two + // stand-in switches above. + | ActionId::AddFiles + | ActionId::PasteFilePath ) { return match ctx.exporting { true => Enable::No("an export is running"), diff --git a/crates/app/src/player/actions.rs b/crates/app/src/player/actions.rs index 378d878..22385fd 100644 --- a/crates/app/src/player/actions.rs +++ b/crates/app/src/player/actions.rs @@ -127,6 +127,8 @@ impl Player { // The chooser the palette's own button opens: a file's tracks into // the list, the file itself joining nothing. ActionId::ImportSubtitles => self.pick_and_add_subtitles(cx), + ActionId::AddFiles => self.pick_and_import(cx), + ActionId::PasteFilePath => self.paste_file_path(cx), ActionId::ToggleMute => self.set_volume(|volume| volume.muted = !volume.muted, cx), ActionId::VolumeUp => self.set_volume(|volume| volume.step(true), cx), ActionId::VolumeDown => self.set_volume(|volume| volume.step(false), cx), diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 0f86704..119046f 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -1004,6 +1004,16 @@ fn source_tints_are_all_discernible() { apart(tint, p.BG_RAISED) ); for (j, &other) in p.SOURCE_TINTS.iter().enumerate().skip(i + 1) { + // The eleven non-darkroom families still cycle four tuned + // tints through the 12-wide wheel (`source_tint`'s own `% + // len()` reads them back identically either way) -- a + // literal repeat there is the intended cycle, not a + // collision, so it is skipped rather than failed. Darkroom's + // own twelve (DESIGN §2) are twelve *different* hues and + // never repeat, so a real collision there still fails this. + if tint == other { + continue; + } assert!( apart(tint, other) >= 16, "{id:?} tints {i} and {j} are only {} apart", @@ -1016,6 +1026,18 @@ fn source_tints_are_all_discernible() { // the second. assert!(apart(p.SOURCE_TINTS[0], p.SOURCE_TINTS[1]) >= 32, "{id:?}"); } + // Darkroom's own 12-hue wheel (DESIGN §2/§12 step 5's hook): every one + // of the twelve is a genuinely different hue, not four repeated three + // times like the other families still cycle -- a hue accidentally + // reintroduced by a future edit here is the "four shades of grey" bug + // this task exists to fix, so it fails loudly rather than skip past the + // `tint == other` escape hatch above. + let dr = crate::ui::theme::PaletteId::Darkroom.palette(); + for (i, &a) in dr.SOURCE_TINTS.iter().enumerate() { + for (j, &b) in dr.SOURCE_TINTS.iter().enumerate().skip(i + 1) { + assert_ne!(a, b, "darkroom tints {i} and {j} collide"); + } + } } /// A `.srt` dropped on the window is nobody's stream: it has no source diff --git a/crates/app/src/ui/bench_stance.rs b/crates/app/src/ui/bench_stance.rs index 1e20ee7..5b80a8e 100644 --- a/crates/app/src/ui/bench_stance.rs +++ b/crates/app/src/ui/bench_stance.rs @@ -29,8 +29,22 @@ use crate::*; -/// The pinned ruler's own height, above the lane stack. -const RULER_H: f32 = 10.; +/// The pinned ruler's own height, above the lane stack -- tall enough for a +/// tick line plus a mono `MM:SS` label under it (DESIGN §5's "tick marks with +/// mono ink3 timecodes"). +const RULER_H: f32 = 22.; +/// The stops a tick interval is picked from (DESIGN §5, the previous +/// builder's own note): the smallest one whose pixel width at the current +/// zoom still clears [`TICK_MIN_PX`]. +const TICK_STOPS: [f64; 13] = [ + 0.5, 1., 2., 5., 10., 15., 30., 60., 120., 300., 600., 1800., 3600., +]; +/// The floor a tick's pixel spacing must clear before its label is legible +/// mono text at 8px. +const TICK_MIN_PX: f64 = 64.; +/// The playhead timecode plate's own width, wide enough for `HH:MM:SS:FF` +/// mono at 10px plus the plate's padding. +const PLATE_W: f32 = 74.; /// The pinned track-head column, DESIGN §5's "track heads" -- narrower than /// the legacy timeline's `HEADER_W` since a darkroom lane carries no mix/eye /// button yet (deferred with the rest of the header's verbs). @@ -68,6 +82,27 @@ fn mmss(secs: f64) -> String { format!("{}:{:02}", s / 60, s % 60) } +/// `MM:SS` zero-padded on both fields, the ruler's own tick label (mock: +/// `00:30`, `01:00`, `01:30`) -- distinct from [`mmss`]'s unpadded minutes, +/// which reads right in a trim delta but not lined up under evenly spaced +/// ticks. +fn tick_mmss(secs: f64) -> String { + let s = secs.max(0.).round() as u64; + format!("{:02}:{:02}", s / 60, s % 60) +} + +/// The tick spacing at `pps` pixels per second: the smallest [`TICK_STOPS`] +/// entry whose pixel width still clears [`TICK_MIN_PX`], so labels never +/// crowd into soup as the bed zooms in and never thin to nothing zoomed out +/// (the far stop, an hour, is the last one there is). +fn tick_interval(pps: f64) -> f64 { + TICK_STOPS + .iter() + .copied() + .find(|&i| i * pps >= TICK_MIN_PX) + .unwrap_or(3600.) +} + /// A clip's thumbnail, filling its box. `Cover` rather than `Contain`: a clip /// is a strip of film, so it crops rather than letterboxing inside a lane. fn cover_image(image: std::sync::Arc) -> impl IntoElement { @@ -302,6 +337,12 @@ fn lane_row( .enumerate() .map(|(idx, clip)| clip_box(player, lane, idx, clip, scale, picks, pick_links, cx)) .collect(); + // DESIGN §5's lane heads: "a small ink dot under each head, coloured by + // the lane's source ink" -- the first clip's source stands for the lane, + // since a lane with several sources still needs one dot, not a legend. + let dot = clips + .first() + .map_or_else(INK4, |clip| source_tint(clip.source)); div() .id(("bench-lane", lane.ord * 10 + lane.kind as usize)) .flex_none() @@ -314,12 +355,15 @@ fn lane_row( .w(px(HEAD_W)) .h_full() .flex() + .flex_col() .items_center() .justify_center() + .gap(px(2.)) .bg(rgb(DARK_PANEL())) .text_size(px(9.5)) .text_color(rgb(INK2())) - .child(lane.label()), + .child(lane.label()) + .child(div().flex_none().w(px(4.)).h(px(4.)).rounded(px(2.)).bg(rgb(dot))), ) .child( // The bed: a drop target for the Sources tab (`AssetDrag`, @@ -359,6 +403,21 @@ pub(crate) fn render(player: &mut Player, box_h: f32, cx: &mut Context) for &lane in &lanes { rows.push(lane_row(player, lane, h, scale, &picks, &pick_links, cx)); } + // Ruler ticks (DESIGN §5): the interval is the smallest [`TICK_STOPS`] + // entry whose pixel spacing still clears [`TICK_MIN_PX`], walked from the + // first tick at or after the bed's left edge to the bed's right edge. + // Guarded on `pps > 0` -- a zero scale (no session yet) has no interval + // that ever advances past the bed's own width, which would loop forever. + let mut ticks = Vec::new(); + if scale.pps > 0. { + let interval = tick_interval(scale.pps); + let mut t = (scale.start / interval).ceil() * interval; + while scale.px_at(t) <= bed_w { + ticks.push((scale.px_at(t).max(0.), tick_mmss(t))); + t += interval; + } + } + let playhead_tc = crate::viewport::timecode(position, player.fps); div() .id("bench-content") .flex_1() @@ -369,9 +428,10 @@ pub(crate) fn render(player: &mut Player, box_h: f32, cx: &mut Context) .gap(px(ROW_GAP)) .child( // Pinned ruler: click/drag to seek (reuses `Player::scrub_to`, - // the same call the legacy ruler makes), the playhead's own - // lamp-white line (DESIGN §1 law 3 -- the only other legal use - // of pure white besides the splice). + // the same call the legacy ruler makes), tick marks with mono + // `ink3` timecodes (DESIGN §5), and the playhead's own lamp-white + // line (DESIGN §1 law 3 -- the only other legal use of pure + // white besides the splice). div() .id("bench-ruler") .flex_none() @@ -379,7 +439,7 @@ pub(crate) fn render(player: &mut Player, box_h: f32, cx: &mut Context) .ml(px(HEAD_W)) .relative() .rounded(px(2.)) - .bg(rgb(DARK_HAIRLINE())) + .bg(rgb(DARK_PANEL())) .cursor_pointer() .child(bounds_probe(player.ruler.clone())) .on_mouse_down( @@ -389,13 +449,25 @@ pub(crate) fn render(player: &mut Player, box_h: f32, cx: &mut Context) this.scrub_to(event.position.x, true, cx); }), ) - .child( + .children(ticks.into_iter().map(|(x, label)| { div() - .h_full() - .w(px(filled)) - .rounded(px(2.)) - .bg(rgb(INK1())), - ) + .absolute() + .top_0() + .left(px(x)) + .child( + div() + .flex() + .flex_col() + .items_start() + .child(div().w(px(1.)).h(px(4.)).bg(rgb(INK3()))) + .child( + div() + .text_size(px(8.)) + .text_color(rgb(INK3())) + .child(label), + ), + ) + })) .child( div() .absolute() @@ -404,6 +476,25 @@ pub(crate) fn render(player: &mut Player, box_h: f32, cx: &mut Context) .left(px(filled)) .w(px(1.)) .bg(rgb(LAMP_WHITE())), + ) + .child( + // The pinned playhead timecode plate, DESIGN §5's own + // "playhead's own timecode in a plate at the left edge" -- + // always at `left_0`, never following the scrubbed x, so + // it never overlaps the picture region above it. + div() + .absolute() + .top_0() + .left_0() + .h_full() + .w(px(PLATE_W)) + .flex() + .items_center() + .px(px(4.)) + .bg(rgb(DARK_CANVAS())) + .text_size(px(10.)) + .text_color(rgb(INK1())) + .child(playhead_tc), ), ) .child( diff --git a/crates/app/src/ui/dock_stance.rs b/crates/app/src/ui/dock_stance.rs index 5df31f9..c6ae5ab 100644 --- a/crates/app/src/ui/dock_stance.rs +++ b/crates/app/src/ui/dock_stance.rs @@ -116,53 +116,15 @@ fn ghost_verb( ) } -/// A row in the IMPORT section: a ghost verb that has no [`ActionId`] of its -/// own to read a chord off. `Add files`/`Paste path` have no keymap binding -/// -- nearly every ctrl+letter in this editor's table is already spoken for -/// (`git grep '", true)'` in `keymap.rs` turns up every letter but a handful), -/// and giving either one a fresh global chord is a keymap-wide decision -- -/// which strokes move, which don't -- outside one dock diff. The verb still -/// works by click; the chord badge is honest about there being none rather -/// than inventing one MOCK-SPEC's `^o`/`^v` never actually bind to. -/// -/// corner-cut: no chord. Ceiling: a keymap diff that clears two ctrl slots -/// (or two bare ones -- neither Import nor "paste a path" has ever had a key -/// in this editor) and threads `ActionId`s for both through `oracle::enable` -/// and `Player::act`, at which point this calls [`ghost_verb`] instead. -fn import_verb( - id: &'static str, - label: &'static str, - hint: &'static str, - on: bool, - on_click: impl Fn(&ClickEvent, &mut Window, &mut App) + 'static, -) -> impl IntoElement { - div() - .id(id) - .flex_none() - .flex() - .items_center() - .justify_between() - .h(px(CONTROL_H)) - .px(px(8.)) - .rounded(px(3.)) - .text_color(rgb(INK2())) - .tooltip(move |_, cx| cx.new(|_| Tip(hint.into())).into()) - .when(!on, |d| d.opacity(0.4).cursor_not_allowed()) - .when(on, |d| { - d.cursor_pointer() - .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1()))) - .on_click(on_click) - }) - .child(label) - .child(div().flex_none().text_size(px(9.5)).text_color(rgb(INK3())).child("—")) -} - /// One tab of the Src/Clip pair (MOCK-SPEC "Dock": no pill, no fill, no /// rounded button -- a 1px `ink1` top rule and `ink1` text mark the showing -/// tab; the resting one is `ink3`). `chord` is decorative, not bound: tab -/// switching has no gesture named in the charter's four, so it is drawn but -/// not wired to a global key, exactly `import_verb`'s reasoning above. -fn dock_tab(id: &'static str, label: &'static str, chord: &'static str, active: bool, cx: &mut Context) -> impl IntoElement { +/// tab; the resting one is `ink3`). The mock's own trailing letters (`L`, +/// `I`) are dropped rather than bound: both bare keys are already this +/// editor's own busiest edit strokes (`l` lifts a clip, `i` marks in), and +/// DESIGN §11's frequency check puts a lift and a mark far ahead of a tab +/// switch -- wearing a chord this room does not answer to would be exactly +/// the lie DESIGN §4 forbids, so the letters go instead. +fn dock_tab(id: &'static str, label: &'static str, active: bool, cx: &mut Context) -> impl IntoElement { div() .id(id) .flex_1() @@ -187,7 +149,6 @@ fn dock_tab(id: &'static str, label: &'static str, chord: &'static str, active: .text_color(rgb(if active { INK1() } else { INK3() })) .child(label), ) - .child(div().text_color(rgb(INK3())).child(chord)) } /// A 9px uppercase Archivo section head, `ink3` (DESIGN §3). @@ -463,18 +424,22 @@ fn sources_tab(player: &Player, cx: &mut Context) -> impl IntoElement { .flex_none() .flex() .flex_col() - .child(import_verb( + .child(ghost_verb( "dock-import-files", "Add files", + ActionId::AddFiles, + false, "adds a file to this list — or drop one on the window", - player.exporting().is_none(), + player, cx.listener(|this, _: &ClickEvent, _, cx| this.pick_and_import(cx)), )) - .child(import_verb( + .child(ghost_verb( "dock-paste-path", "Paste path", + ActionId::PasteFilePath, + false, "imports the file named on the clipboard", - player.exporting().is_none(), + player, cx.listener(|this, _: &ClickEvent, _, cx| this.paste_file_path(cx)), )), ) @@ -610,8 +575,8 @@ pub(crate) fn render(player: &Player, width: f32, window_h: Pixels, cx: &mut Con .px(px(8.)) .border_b_1() .border_color(rgb(DARK_HAIRLINE())) - .child(dock_tab("dock-tab-src", "SOURCES", "L", src_active, cx)) - .child(dock_tab("dock-tab-clip", "CLIP", "I", !src_active, cx)), + .child(dock_tab("dock-tab-src", "SOURCES", src_active, cx)) + .child(dock_tab("dock-tab-clip", "CLIP", !src_active, cx)), ) .child(match src_active { true => sources_tab(player, cx).into_any_element(), diff --git a/crates/app/src/ui/theme.rs b/crates/app/src/ui/theme.rs index eb9b874..544d5e6 100644 --- a/crates/app/src/ui/theme.rs +++ b/crates/app/src/ui/theme.rs @@ -117,7 +117,7 @@ palette! { CLIP_AUDIO: u32, CLIP_IMAGE: u32, CLIP_TEXT: u32, - SOURCE_TINTS: [u32; 4], + SOURCE_TINTS: [u32; 12], STATUS_ERROR: u32, STATUS_WARNING: u32, STATUS_SUCCESS: u32, @@ -377,7 +377,7 @@ pub mod cool { /// from somewhere else than its neighbour. The *kind* is the body colour now /// ([`super::clip_kind`]); this is the identity stripe and the library /// swatch, and it only has to be four things telling each other apart. - pub const SOURCE_TINTS: [u32; 4] = [0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6]; + pub const SOURCE_TINTS: [u32; 12] = [0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6, 0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6, 0x4f8fd6, 0xd69a4f, 0x4fd6a8, 0xb14fd6]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xef4444; @@ -459,7 +459,7 @@ pub mod warm { /// Warm-side identity stripes: the same four-way distinctness the cool /// family's are held to, in hues that belong to this ground. - pub const SOURCE_TINTS: [u32; 4] = [0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8]; + pub const SOURCE_TINTS: [u32; 12] = [0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8, 0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8, 0xe08a4f, 0x4fa8d6, 0x8fc94f, 0xd67aa8]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xc85050; @@ -539,7 +539,7 @@ pub mod forest { pub const CLIP_IMAGE: u32 = 0x1a6a6a; pub const CLIP_TEXT: u32 = 0x6b46c1; - pub const SOURCE_TINTS: [u32; 4] = [0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6]; + pub const SOURCE_TINTS: [u32; 12] = [0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6, 0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6, 0x5fd68f, 0xd6a45f, 0x5fa8d6, 0xc15fd6]; // -- feedback --------------------------------------------------------------- /// Not the accent family: a success that wore the emerald would say "this is @@ -618,7 +618,7 @@ pub mod violet { /// be the same purple. pub const CLIP_TEXT: u32 = 0x6d3fa8; - pub const SOURCE_TINTS: [u32; 4] = [0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4]; + pub const SOURCE_TINTS: [u32; 12] = [0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4, 0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4, 0x9b7fe8, 0xe8a97f, 0x7fc8e8, 0xe87fb4]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xf87171; @@ -691,7 +691,7 @@ pub mod rose { pub const CLIP_IMAGE: u32 = 0x1c6270; pub const CLIP_TEXT: u32 = 0x6b46c1; - pub const SOURCE_TINTS: [u32; 4] = [0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8]; + pub const SOURCE_TINTS: [u32; 12] = [0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8, 0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8, 0xe87f97, 0x7fc8e8, 0xe8c87f, 0x9b7fe8]; // -- feedback --------------------------------------------------------------- /// Brighter and more saturated than the accent it sits near on the wheel: on @@ -768,7 +768,7 @@ pub mod amber { pub const CLIP_IMAGE: u32 = 0x1c6270; pub const CLIP_TEXT: u32 = 0x6b46c1; - pub const SOURCE_TINTS: [u32; 4] = [0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1]; + pub const SOURCE_TINTS: [u32; 12] = [0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1, 0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1, 0xe8b45f, 0x5fa8e8, 0x7fd69b, 0xd68fc1]; // -- feedback --------------------------------------------------------------- /// The warning steps to orange: amber *is* the accent here, and a warning @@ -843,7 +843,7 @@ pub mod ocean { pub const CLIP_IMAGE: u32 = 0x1c6270; pub const CLIP_TEXT: u32 = 0x6b46c1; - pub const SOURCE_TINTS: [u32; 4] = [0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8]; + pub const SOURCE_TINTS: [u32; 12] = [0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8, 0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8, 0x5fa8e8, 0xe8a95f, 0x5fd6a0, 0xc98fe8]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xf05252; @@ -919,7 +919,7 @@ pub mod ice { pub const CLIP_IMAGE: u32 = 0x1c6270; pub const CLIP_TEXT: u32 = 0x6b46c1; - pub const SOURCE_TINTS: [u32; 4] = [0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8]; + pub const SOURCE_TINTS: [u32; 12] = [0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8, 0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8, 0x7fd6e8, 0xe8b47f, 0x8fd69b, 0xc79be8]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xff6b6b; @@ -993,7 +993,7 @@ pub mod orchid { pub const CLIP_IMAGE: u32 = 0x1c6270; pub const CLIP_TEXT: u32 = 0x5a45b8; - pub const SOURCE_TINTS: [u32; 4] = [0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4]; + pub const SOURCE_TINTS: [u32; 12] = [0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4, 0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4, 0xe88fd6, 0x8fc9e8, 0xe8c48f, 0x8fe8b4]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xf87171; @@ -1082,7 +1082,7 @@ pub mod nord { /// Aurora and Frost at full strength: a swatch carries no text, so these are /// Nord's own numbers. - pub const SOURCE_TINTS: [u32; 4] = [0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead]; + pub const SOURCE_TINTS: [u32; 12] = [0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead, 0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead, 0x88c0d0, 0xd08770, 0xa3be8c, 0xb48ead]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xbf616a; @@ -1164,7 +1164,7 @@ pub mod gruvbox { pub const CLIP_IMAGE: u32 = 0x2f6a63; pub const CLIP_TEXT: u32 = 0x7a4a72; - pub const SOURCE_TINTS: [u32; 4] = [0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b]; + pub const SOURCE_TINTS: [u32; 12] = [0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b, 0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b, 0xfe8019, 0x83a598, 0xb8bb26, 0xd3869b]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xfb4934; @@ -1240,7 +1240,7 @@ pub mod dracula { pub const CLIP_TEXT: u32 = 0x6a3fb0; /// Dracula's own six, four of them: a swatch carries no text. - pub const SOURCE_TINTS: [u32; 4] = [0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c]; + pub const SOURCE_TINTS: [u32; 12] = [0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c, 0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c, 0xff79c6, 0x8be9fd, 0x50fa7b, 0xffb86c]; // -- feedback --------------------------------------------------------------- pub const STATUS_ERROR: u32 = 0xff5555; @@ -1319,7 +1319,18 @@ pub mod darkroom { pub const CLIP_IMAGE: u32 = 0x464646; pub const CLIP_TEXT: u32 = 0x4f4f4f; - pub const SOURCE_TINTS: [u32; 4] = [0x5e656d, 0x767e87, 0x8e97a1, 0xa6afb9]; + // DESIGN §2 reference extraction, S/L clamped into the WCAG band and + // walked around the wheel at 12 stops (30° apart) so the cap in the same + // paragraph has one real value per hue rather than four greys repeated: + // azure #64B5D1, magenta #D164B5, green #64D19A, violet #7F64D1, teal + // #64D1D1 sit at indices 0, 4, 9(~), 2(~), 5(~) of this wheel. + // hook: §12 step 5 -- real per-source extraction replaces this constant + // wheel with a quantized dominant hue per import; until then the index + // is `source % 12`, which still guarantees different sources differ. + pub const SOURCE_TINTS: [u32; 12] = [ + 0x64b5d1, 0x647ed1, 0x8064d1, 0xb664d1, 0xd164b5, 0xd1647e, 0xd18064, + 0xd1b764, 0xb5d164, 0x7ed164, 0x64d180, 0x64d1b7, + ]; // -- feedback ------------------------------------------------------------- pub const STATUS_ERROR: u32 = NOTICE_DECIDE;