Color Effects: Randomize Fill Colors gives each selected filled path its own random fill

Object › Plug-ins › Color Effects › Randomize Fill Colors… gives each
selected filled path and compound path, and each one inside the selected
groups and clipping groups, a fill color of its own, picked at random
from a seed, as one undo step (none when no fill changes).

- addon.color.randomFill {scheme?, swatch?, min?, max?, seed?, ids?}:
  "color" picks red, green and blue at random in the document's color
  mode, "tint" picks a linked tint of a global or spot swatch, and "gray"
  picks a gray, the tints and grays between min and max percent.
- Unfilled paths, clipping paths (compound ones included), hidden and
  locked objects and the objects in hidden or locked groups and layers,
  type, images, symbol instances, blends and envelopes keep their fills.
  A compound path's member given by id colors the compound path, and an
  object reached twice is colored once.
- Bad params are refused: an unknown scheme, min or max with "color",
  swatch without "tint", a percent outside 0 to 100, min above max, a
  missing or process swatch, and a seed that is not a whole number.
- The dialog has Colors, Swatch (the document's global and spot
  swatches), Minimum, Maximum and Seed, with Preview; OK is off while the
  minimum is above the maximum or tints have no swatch.

Docs: docs/mcp.md, ROADMAP, docs/target-app-parity.md, docs/ui-parity.md.
This commit is contained in:
dotCooCoo committed 2026-11-29 07:23:57 -08:00
1 parent d4d8da4544
commit 9334f11ddf
15 files changed
+688 -3

No files matched your search

+1
View File
@@ -160,6 +160,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-11-11: Pattern libraries: Patterns › Grit Textures, a second built-in pattern library, holds eight seamless black textures (Fine Grain, Coarse Grit, Sand, Speckle, Stipple, Scratches, Sparse Flecks and Dense Flecks) on tiles of 18 to 36 pt, each drawn the same way every time; marks that reach past a tile edge continue on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged.
- 2026-11-11: Pattern libraries: Patterns › Optical Effects, a third built-in pattern library, of VectorCraft's own designs, holds eight black wave, moiré and op-art tiles (Sine Bands, Ripple Lines, Interference Rings, Offset Rings, Warped Checks, Pinched Stripes, Chevron Pulse and Radiating Lenses) of 32 to 48 pt, each drawn the same way every time; each tile is one period of its design, and art that reaches past a tile edge continues on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged.
- 2026-11-01: Find Nearest Swatch joins the Color Effects add-on (Object › Plug-ins › Color Effects): for each colour of the selection, the closest swatches of the document, a built-in library or a library or colour book the user loaded, with their CIEDE2000 difference; Apply gives each colour its nearest swatch as one undo step, linking global and spot swatches and adding a library's to the document first, so a process colour becomes the closest spot colour (`addon.color.nearestSwatch`, `addon.color.applyNearestSwatch`, #4923).
- 2026-11-29: Randomize Fill Colors joins the Color Effects add-on (Object › Plug-ins › Color Effects): each selected filled path and compound path, inside groups too, gets a fill color of its own at random: any color, tints of a global or spot swatch, or grays between a minimum and a maximum percent, with a seed that repeats the result and Preview, as one undo step (`addon.color.randomFill`).
- 2026-11-01: Expand Dashes into Paths joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): each selected path's dashed stroke becomes separate open paths, one per dash, laid out exactly as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off, so the gaps are real gaps for cutters and plotters, as one undo step (`addon.pathtools.expandDashes`, #4922).
- 2026-11-01: Randomize Opacity joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): each selected object gets its own opacity at random between a minimum and a maximum percent, with a seed that repeats the result, as one undo step (`addon.arrange.randomizeOpacity`, #4925).
- 2026-11-01: Sort Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects are sorted by width, height, area, position, opacity or stacking order (small to large, large to small or at random) and take another of those in that order, trading their values or stepping them evenly, as one undo step (`addon.arrange.sort`, #4917).
+12 -1
View File
@@ -5,12 +5,14 @@
//! Print Ink Fixes ([`print_fixes`]) prepares a CMYK document's inks for print, Find Nearest
//! Swatch ([`nearest`]) matches colours to a swatch library's, Create Swatch Legend
//! ([`legend`]) draws labelled chips of the document's swatches, and Apply Fill to Stroke and Apply
//! Stroke to Fill ([`copy_paint`]) copy each object's own paint across. Its panel and its submenu,
//! Stroke to Fill ([`copy_paint`]) copy each object's own paint across, and Randomize Fill Colors
//! ([`random_fill`]) gives each filled path its own color at random. Its panel and its submenu,
//! Object › Plug-ins › Color Effects, are the UI's.
pub mod legend;
mod nearest;
mod print_fixes;
mod random_fill;
#[cfg(test)]
mod tests;
@@ -92,6 +94,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_doc,
|s, p| copy_paint(s, p, false)
),
cmd!(
"addon.color.randomFill",
"Randomize Fill Colors",
["Object", "Plug-ins", "Color Effects"],
None,
"{scheme?: \"color\" (any color: red, green and blue each at random, in the document's color mode) | \"tint\" (a tint of `swatch`, linked to it) | \"gray\" (a gray) (\"color\"), swatch?: a global or spot color swatch's name (tint only, and needed there; a tint swatch gives tints of its base), min?: % 0..100 (0), max?: % 0..100 (100; not less than min) (tint and gray only: the tint, or the gray's black, ranges from min to max), seed?: whole number (0; the same seed, objects and settings give the same colors), ids?: [id…] (default: the selection)} give each selected filled path and compound path, and each one inside the selected groups, its own top fill color, picked at random and evenly within the scheme, as one undo step (none when no fill changes). Paths and compound paths with no fill, clipping paths, hidden and locked objects (and objects in hidden or locked groups and layers), type, images, symbol instances, blends and envelopes keep their fills; a gradient or pattern fill becomes the color. On paths directly in a graph series whose fill changes, the graph stores the fill of the frontmost of them for its next redraw, which gives every mark of the series that one color (docs/mcp.md) → {count: objects whose fill changed}",
has_selection,
random_fill::run
),
]
.into_iter()
.chain(legend::specs())
@@ -0,0 +1,145 @@
//! Randomize Fill Colors (`addon.color.randomFill`, Object › Plug-ins › Color Effects › Randomize
//! Fill Colors…): each selected filled path and compound path, and each one inside the selected
//! groups, gets a fill color of its own, picked at random from a seed: any color, a tint of one
//! global or spot swatch, or a gray, as one undo step.
#[cfg(test)]
mod tests;
use serde_json::{Value, json};
use vectorcraft_color::recolor::Rng;
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::{Document, Node, NodeId, NodeKind};
use super::super::super::colorcmds::{edit_if_changed, keeping_series_paint};
use super::super::super::graph::paint_targets;
use super::super::super::menucmds::whole_or;
use super::super::super::paint::swatch_solid;
use super::super::super::{bad, checked_ids_or_selection, number_or, text_param};
use crate::{Result, Session};
const C: &str = "addon.color.randomFill";
/// The schemes the colors are picked from (`scheme`).
pub const SCHEMES: [&str; 3] = ["color", "tint", "gray"];
/// How each color is picked.
enum Scheme {
/// Any color: red, green and blue each at random, in the document's color mode.
Color,
/// A tint of the swatch, from the least to the most (0..1).
Tint(String, f32, f32),
/// A gray, from the least black to the most (0..1).
Gray(f32, f32),
}
/// The percentage `p` gives for `key` (`default` when left out) as a fraction.
fn percent(p: &Value, key: &str, default: f64) -> Result<f32> {
let v = number_or(p, key, default, C)?;
if (0.0..=100.0).contains(&v) { Ok((v / 100.0) as f32) } else { Err(bad(C, format!("`{key}` must be from 0 to 100"))) }
}
/// The scheme `p` asks for, checked against the document's swatches.
fn scheme(s: &Session, p: &Value) -> Result<Scheme> {
let name = text_param(p, "scheme", C)?.unwrap_or("color");
if !SCHEMES.contains(&name) {
return Err(bad(C, "`scheme` must be color, tint or gray"));
}
let given = |key: &str| p.get(key).is_some_and(|v| !v.is_null());
if name == "color" && (given("min") || given("max")) {
return Err(bad(C, "`min` and `max` go with scheme tint or gray"));
}
if name != "tint" && given("swatch") {
return Err(bad(C, "`swatch` goes with scheme tint"));
}
if name == "color" {
return Ok(Scheme::Color);
}
let (min, max) = (percent(p, "min", 0.0)?, percent(p, "max", 100.0)?);
if min > max {
return Err(bad(C, "`min` is greater than `max`"));
}
if name == "gray" {
return Ok(Scheme::Gray(min, max));
}
let swatch = text_param(p, "swatch", C)?.ok_or_else(|| bad(C, "scheme tint needs a `swatch`: a global or spot color swatch"))?;
swatch_solid(&s.doc()?.doc, swatch, Some(1.0)).map_err(|e| bad(C, e))?;
Ok(Scheme::Tint(swatch.to_string(), min, max))
}
/// Whether the object `id` is left as it is: it, or a layer or group holding it, is hidden or
/// locked, or it is the clipping path of the group or layer holding it.
fn left_alone(d: &Document, id: NodeId) -> bool {
let Some(line) = d.ancestry(id) else { return true };
let nodes: Vec<&Node> = line.iter().filter_map(|id| d.node(*id)).collect();
if nodes.len() != line.len() || nodes.iter().any(|n| !n.visible || n.locked) {
return true;
}
matches!(nodes.as_slice(), [.., parent, n] if parent.clips() && parent.children().and_then(|c| c.first()).is_some_and(|c| c.id == n.id))
}
/// Add to `out` `n` when it is a filled path or compound path that is shown and unlocked, or the
/// ones inside it when it is a group or a layer. A clipping path (the first object of a clipping
/// group or clipped layer, a compound path included), a guide, type, images, symbol instances,
/// blends and envelopes are left as they are.
fn filled(n: &Node, out: &mut Vec<NodeId>) {
if !n.visible || n.locked {
return;
}
match &n.kind {
NodeKind::Group { children, .. } | NodeKind::Layer { children, .. } => {
for c in children.iter().skip(usize::from(n.clips())) {
filled(c, out);
}
}
NodeKind::Path { clipping: false, guide: false, .. } | NodeKind::Compound { .. } if !n.appearance.fill_paint().is_none() => out.push(n.id),
_ => {}
}
}
pub(super) fn run(s: &mut Session, p: &Value) -> Result<Value> {
let scheme = scheme(s, p)?;
let mut rng = Rng::new(whole_or(p, "seed", 0, C)?);
let ids = checked_ids_or_selection(s, p, C)?;
if ids.is_empty() {
return Ok(json!({ "count": 0 }));
}
let model = s.doc()?.doc.color_mode.model();
// A run that gives every object the fill it has records no undo step.
let count = edit_if_changed(s, "Randomize Fill Colors", |before, d| {
// A graph's series group stands for its marks, as for `paint.setFill`.
let roots = paint_targets(before, &ids);
let mut targets = vec![];
for id in &roots {
let id = before
.parent_of(*id)
.filter(|parent| before.node(*parent).is_some_and(|n| matches!(n.kind, NodeKind::Compound { .. })))
.unwrap_or(*id);
if left_alone(before, id) {
continue;
}
let Some(n) = before.node(id) else { continue };
filled(n, &mut targets);
}
let mut seen = std::collections::HashSet::new();
targets.retain(|id| seen.insert(*id));
let count = keeping_series_paint(d, &roots, |d| {
let mut count = 0;
for id in &targets {
let paint = match &scheme {
Scheme::Color => Paint::solid(Color::rgb(rng.range(0.0, 1.0), rng.range(0.0, 1.0), rng.range(0.0, 1.0)).in_model(model)),
Scheme::Tint(swatch, lo, hi) => swatch_solid(d, swatch, Some(rng.range(*lo, *hi))).map_err(|e| bad(C, e))?,
Scheme::Gray(lo, hi) => Paint::solid(Color::gray(rng.range(*lo, *hi))),
};
if let Some(n) = d.node_mut(*id)
&& n.appearance.fill_paint() != paint
{
n.appearance.set_fill(paint);
count += 1;
}
}
Ok(count)
})?;
Ok((count, count > 0))
})?;
Ok(json!({ "count": count }))
}
@@ -0,0 +1,261 @@
//! Randomize Fill Colors: the colors each scheme gives, which objects take them, one undo step, and
//! bad params refused without a change.
use serde_json::{Value, json};
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::{NodeId, NodeKind};
use crate::Session;
const C: &str = "addon.color.randomFill";
fn session() -> Session {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
s
}
fn rect(s: &mut Session, x: f64) -> NodeId {
NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 0, "width": 5, "height": 5})).unwrap()["id"].as_u64().unwrap())
}
fn rects(s: &mut Session, n: usize) -> Vec<NodeId> {
(0..n).map(|i| rect(s, i as f64 * 10.0)).collect()
}
fn select(s: &mut Session, ids: &[NodeId]) {
s.execute("select.set", &json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})).unwrap();
}
fn fill(s: &Session, id: NodeId) -> Paint {
s.doc().unwrap().doc.node(id).unwrap().appearance.fill_paint()
}
fn fills(s: &Session, ids: &[NodeId]) -> Vec<Paint> {
ids.iter().map(|id| fill(s, *id)).collect()
}
fn steps(s: &Session) -> usize {
s.doc().unwrap().history.undo.len()
}
fn enabled(s: &Session, cmd: &str) -> bool {
s.commands().into_iter().find(|c| c.id == cmd).unwrap().enabled
}
#[test]
fn each_object_gets_its_own_color_from_the_seed() {
let mut s = session();
let ids = rects(&mut s, 12);
select(&mut s, &ids);
let before = fills(&s, &ids);
let n = steps(&s);
let r = s.execute(C, &json!({"seed": 7})).unwrap();
assert_eq!(r["count"], json!(12));
assert_eq!(steps(&s), n + 1, "one undo step");
let first = fills(&s, &ids);
assert!(first.iter().all(|p| matches!(p, Paint::Solid { color: Color::Rgb { .. }, swatch: None, .. })), "{first:?}");
assert!(first.windows(2).all(|w| w[0] != w[1]), "each its own: {first:?}");
s.execute("edit.undo", &json!({})).unwrap();
assert_eq!(fills(&s, &ids), before, "undone");
// The same seed repeats them; another seed doesn't.
s.execute(C, &json!({"seed": 7})).unwrap();
assert_eq!(fills(&s, &ids), first);
s.execute(C, &json!({"seed": 8})).unwrap();
assert_ne!(fills(&s, &ids), first);
}
#[test]
fn repeated_ids_take_one_color_from_the_seed() {
let mut s = session();
let a = rect(&mut s, 0.0);
assert_eq!(s.execute(C, &json!({"ids": [a.0], "seed": 7})).unwrap()["count"], json!(1));
let once = fill(&s, a);
s.execute("edit.undo", &json!({})).unwrap();
assert_eq!(s.execute(C, &json!({"ids": [a.0, a.0], "seed": 7})).unwrap()["count"], json!(1));
assert_eq!(fill(&s, a), once);
}
#[test]
fn a_cmyk_document_gets_cmyk_colors() {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 400, "height": 300, "colorMode": "cmyk"})).unwrap();
let ids = rects(&mut s, 3);
select(&mut s, &ids);
s.execute(C, &json!({"scheme": "color"})).unwrap();
assert!(fills(&s, &ids).iter().all(|p| matches!(p, Paint::Solid { color: Color::Cmyk { .. }, .. })), "{:?}", fills(&s, &ids));
}
#[test]
fn grays_and_tints_stay_within_the_range() {
let mut s = session();
let ids = rects(&mut s, 20);
select(&mut s, &ids);
s.execute(C, &json!({"scheme": "gray", "min": 20, "max": 40, "seed": 3})).unwrap();
let grays: Vec<f32> = fills(&s, &ids)
.into_iter()
.map(|p| match p {
Paint::Solid { color: Color::Gray { k }, swatch: None, .. } => k,
other => panic!("not a gray: {other:?}"),
})
.collect();
assert!(grays.iter().all(|k| (0.2..=0.4).contains(k)), "{grays:?}");
assert!(grays.windows(2).any(|w| w[0] != w[1]), "{grays:?}");
s.execute("swatch.new", &json!({"name": "Ink", "color": "#e01020", "spot": true})).unwrap();
s.execute(C, &json!({"scheme": "tint", "swatch": "Ink", "min": 10, "max": 50, "seed": 3})).unwrap();
for p in fills(&s, &ids) {
let Paint::Solid { swatch: Some(name), tint, .. } = p else { panic!("not linked: {p:?}") };
assert_eq!(name, "Ink");
assert!((0.1..=0.5).contains(&tint), "{tint}");
}
// min = max gives every object that gray.
s.execute(C, &json!({"scheme": "gray", "min": 45, "max": 45})).unwrap();
assert!(fills(&s, &ids).iter().all(|p| *p == Paint::solid(Color::gray(0.45))));
}
#[test]
fn groups_are_entered_and_unfilled_hidden_and_locked_objects_left_alone() {
let mut s = session();
let [a, b, c, hidden, locked] = [0.0, 10.0, 20.0, 30.0, 40.0].map(|x| rect(&mut s, x));
select(&mut s, &[a, b, c, hidden, locked]);
let g = NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap());
s.execute("paint.setFill", &json!({"ids": [c.0], "none": true})).unwrap();
s.execute("object.hide", &json!({"ids": [hidden.0]})).unwrap();
s.execute("object.lock", &json!({"ids": [locked.0]})).unwrap();
select(&mut s, &[g]);
let (before_hidden, before_locked) = (fill(&s, hidden), fill(&s, locked));
assert!(!before_hidden.is_none() && !before_locked.is_none());
let r = s.execute(C, &json!({"scheme": "gray", "min": 50, "max": 50})).unwrap();
assert_eq!(r["count"], json!(2));
let gray = Paint::solid(Color::gray(0.5));
assert_eq!((fill(&s, a), fill(&s, b), fill(&s, c)), (gray.clone(), gray.clone(), Paint::None), "the unfilled one keeps None");
assert_eq!(fill(&s, g), Paint::None, "the group gets no fill of its own");
assert_eq!((fill(&s, hidden), fill(&s, locked)), (before_hidden, before_locked));
// `ids` stand in for the selection; with nothing selected the menu item is off.
s.execute("select.none", &json!({})).unwrap();
assert!(!enabled(&s, C));
let d = rect(&mut s, 50.0);
s.execute("paint.setFill", &json!({"ids": [d.0], "color": "#336699"})).unwrap();
s.execute("select.none", &json!({})).unwrap();
s.execute(C, &json!({"ids": [d.0], "scheme": "gray", "min": 10, "max": 10})).unwrap();
assert_eq!(fill(&s, d), Paint::solid(Color::gray(0.1)));
assert_eq!(fill(&s, a), gray, "not among ids");
// An object given by id inside a hidden or locked group keeps its fill.
for hide in [true, false] {
let e = rect(&mut s, 60.0);
s.execute("paint.setFill", &json!({"ids": [e.0], "color": "#336699"})).unwrap();
select(&mut s, &[e]);
let outer = NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap());
s.execute(if hide { "object.hide" } else { "object.lock" }, &json!({"ids": [outer.0]})).unwrap();
let kept = fill(&s, e);
assert_eq!(s.execute(C, &json!({"ids": [e.0], "scheme": "gray"})).unwrap()["count"], json!(0), "hidden group: {hide}");
assert_eq!(fill(&s, e), kept);
}
}
#[test]
fn a_compound_path_takes_one_color_and_a_clipping_path_none() {
let mut s = session();
let [a, b] = [0.0, 2.0].map(|x| rect(&mut s, x));
select(&mut s, &[a, b]);
let compound = NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap());
// The topmost becomes the clipping path.
let [art, mask] = [100.0, 102.0].map(|x| rect(&mut s, x));
select(&mut s, &[art, mask]);
let clip = NodeId(s.execute("object.clippingMask.make", &json!({})).unwrap()["id"].as_u64().unwrap());
let is_clipping = |s: &Session, id: NodeId| matches!(s.doc().unwrap().doc.node(id).unwrap().kind, NodeKind::Path { clipping: true, .. });
assert!(is_clipping(&s, mask) && !is_clipping(&s, art));
// A clipping path given a fill still keeps it.
s.execute("paint.setFill", &json!({"ids": [mask.0], "color": "#00ff00"})).unwrap();
let mask_fill = fill(&s, mask);
assert!(!mask_fill.is_none());
select(&mut s, &[compound, clip]);
let r = s.execute(C, &json!({"scheme": "gray", "min": 30, "max": 30})).unwrap();
assert_eq!(r["count"], json!(2), "the compound path and the clipped art");
assert_eq!(fill(&s, compound), Paint::solid(Color::gray(0.3)));
assert_eq!(fill(&s, art), Paint::solid(Color::gray(0.3)));
assert_eq!(fill(&s, mask), mask_fill, "the clipping path keeps its fill");
// Given by id, the clipping path keeps it too.
assert_eq!(s.execute(C, &json!({"ids": [mask.0], "scheme": "gray"})).unwrap()["count"], json!(0));
assert_eq!(fill(&s, mask), mask_fill);
}
#[test]
fn a_compound_member_given_by_id_colors_the_compound() {
let mut s = session();
let [a, b] = [0.0, 2.0].map(|x| rect(&mut s, x));
select(&mut s, &[a, b]);
let compound = NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap());
let before = fill(&s, compound);
let members = fills(&s, &[a, b]);
assert_eq!(s.execute(C, &json!({"ids": [a.0], "seed": 7})).unwrap()["count"], json!(1));
assert_ne!(fill(&s, compound), before);
assert_eq!(fills(&s, &[a, b]), members);
}
#[test]
fn a_compound_clipping_path_keeps_its_fill() {
let mut s = session();
let art = rect(&mut s, 0.0);
let [a, b] = [0.0, 2.0].map(|x| rect(&mut s, x));
select(&mut s, &[a, b]);
let compound = NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap());
select(&mut s, &[art, compound]);
let clip = NodeId(s.execute("object.clippingMask.make", &json!({})).unwrap()["id"].as_u64().unwrap());
assert_eq!(s.doc().unwrap().doc.node(clip).unwrap().children().unwrap()[0].id, compound, "the compound path clips");
s.execute("paint.setFill", &json!({"ids": [compound.0], "color": "#00ff00"})).unwrap();
let mask_fill = fill(&s, compound);
assert!(!mask_fill.is_none());
select(&mut s, &[clip]);
assert_eq!(s.execute(C, &json!({"scheme": "gray", "min": 30, "max": 30})).unwrap()["count"], json!(1), "the clipped art only");
assert_eq!(fill(&s, art), Paint::solid(Color::gray(0.3)));
assert_eq!(fill(&s, compound), mask_fill);
}
#[test]
fn no_undo_step_when_no_fill_changes() {
let mut s = session();
let ids = rects(&mut s, 2);
select(&mut s, &ids);
s.execute(C, &json!({"scheme": "gray", "min": 40, "max": 40})).unwrap();
let n = steps(&s);
let r = s.execute(C, &json!({"scheme": "gray", "min": 40, "max": 40})).unwrap();
assert_eq!((r["count"].clone(), steps(&s)), (json!(0), n), "the same grays again");
// Only unfilled objects: nothing to color.
s.execute("paint.setFill", &json!({"none": true})).unwrap();
let n = steps(&s);
assert_eq!(s.execute(C, &json!({})).unwrap()["count"], json!(0));
assert_eq!(steps(&s), n);
}
#[test]
fn bad_params_are_refused() {
let mut s = session();
let a = rect(&mut s, 0.0);
select(&mut s, &[a]);
s.execute("swatch.new", &json!({"name": "Process", "color": "#336699"})).unwrap();
s.execute("swatch.new", &json!({"name": "Ink", "color": "#e01020", "spot": true})).unwrap();
let (before, n) = (s.doc().unwrap().doc.clone(), steps(&s));
let bad: [(Value, &str); 14] = [
(json!({"scheme": "rainbow"}), "`scheme` must be color, tint or gray"),
(json!({"scheme": 3}), "`scheme` must be a string"),
(json!({"min": 10}), "`min` and `max` go with scheme tint or gray"),
(json!({"scheme": "gray", "swatch": "Ink"}), "`swatch` goes with scheme tint"),
(json!({"scheme": "gray", "min": -1}), "`min` must be from 0 to 100"),
(json!({"scheme": "gray", "max": 101}), "`max` must be from 0 to 100"),
(json!({"scheme": "gray", "min": 80, "max": 20}), "`min` is greater than `max`"),
(json!({"scheme": "gray", "max": "50"}), "`max` must be a number"),
(json!({"scheme": "tint"}), "scheme tint needs a `swatch`"),
(json!({"scheme": "tint", "swatch": "Nope"}), "no swatch `Nope`"),
(json!({"scheme": "tint", "swatch": "Process"}), "is a process colour"),
(json!({"seed": -1}), "`seed` must be a whole number"),
(json!({"seed": 1.5}), "`seed` must be a whole number"),
(json!({"ids": [999_999]}), "no such object id"),
];
for (p, want) in bad {
let e = s.execute(C, &p).unwrap_err().to_string();
assert!(e.contains(want), "{p}: {e}");
}
assert_eq!(steps(&s), n);
assert!(*s.doc().unwrap().doc == *before, "the document is unchanged");
}
@@ -28,6 +28,7 @@ pub(super) const ALLOWED: &[&str] = &[
"addon.color.fillToStroke",
"addon.color.filter",
"addon.color.nearestSwatch",
"addon.color.randomFill",
"addon.color.select",
"addon.color.strokeToFill",
"addon.color.swatchLegend",
@@ -523,6 +523,7 @@ fn ids_null_takes_the_selection_in_every_command_that_falls_back_to_it() {
("addon.cleanup.deepUngroup", json!({}), rect),
("addon.cleanup.rejoin", json!({}), rect),
("addon.color.nearestSwatch", json!({}), rect),
("addon.color.randomFill", json!({"seed": 1}), rect),
("addon.pathtools.cornerSet", json!({"radius": 2}), rect),
("addon.pathtools.cornerRemove", json!({}), rect),
("addon.pathtools.shape.convert", json!({}), rect),
+3
View File
@@ -805,6 +805,9 @@ fn structured_junk() {
("addon.color.nearestSwatch", json!({"library": "spectrum-gradients", "fill": "x", "ids": [u64::MAX]})),
("addon.color.applyNearestSwatch", json!({"library": "web-safe-216", "fill": true, "stroke": true})),
("addon.color.applyNearestSwatch", json!({"library": "nope", "ids": "x", "stroke": 3})),
("addon.color.randomFill", json!({"seed": u64::MAX})),
("addon.color.randomFill", json!({"scheme": "gray", "min": f64::MAX, "max": -1e308, "seed": -1, "ids": [u64::MAX]})),
("addon.color.randomFill", json!({"scheme": "tint", "swatch": "[Registration]", "min": 100, "max": 0, "seed": 1e308, "ids": []})),
("effect.apply", json!({"effect": "no.such.effect"})),
("effect.remove", json!({"index": 99})),
("effect.remove", json!({"indices": [0, 99, u64::MAX]})),
+4 -2
View File
@@ -3,11 +3,12 @@
//! filter, into the colours themselves (`addon.color.filter`); below, under Inks, it opens Duotone's
//! dialog and Print Ink Fixes' (`addon.color.printFixes`). The submenu applies the add-on's live
//! effects, Duotone and Vector Halftone among them (Effect › Color Effects has them too), opens
//! Print Ink Fixes, Find Nearest Swatch ([`nearest`]) and Create Swatch Legend ([`legend`]) and
//! opens the panel.
//! Print Ink Fixes, Find Nearest Swatch ([`nearest`]), Create Swatch Legend ([`legend`]) and
//! Randomize Fill Colors ([`random_fill`]) and opens the panel.
pub mod legend;
pub mod nearest;
pub mod random_fill;
use craft::imaging::ui::adjust::{AdjustContext, AdjustField, AdjustSliders};
use craft::menu::Node;
@@ -116,6 +117,7 @@ pub fn menu() -> Vec<Node> {
// Each selected object's stroke takes its own fill, or the other way (#5530).
cp("Apply Fill to Stroke", "addon.color.fillToStroke", json!({})),
cp("Apply Stroke to Fill", "addon.color.strokeToFill", json!({})),
c("Randomize Fill Colors…", random_fill::COMMAND),
Sep,
sub(
"Select by Color Kind",
@@ -0,0 +1,91 @@
//! Randomize Fill Colors in the interface (Object › Plug-ins › Color Effects › Randomize Fill
//! Colors…): a dialog that picks the colors (any color, tints of a global or spot swatch, or
//! grays), the swatch, the minimum and maximum and the seed, previews on the canvas and runs
//! `addon.color.randomFill` on OK.
use std::borrow::Cow;
use craft::ui::contract::Bind;
use craft::ui::patterns::form_dialogs::{DialogFields, Param, ParamDialog, ParamKind};
use craft::ui::runtime::env::{Label, UnitKind};
use serde_json::{Value, json};
use crate::VectorcraftApp;
use crate::addons::dialogs::Spec;
use crate::dialogs::form;
/// The command OK runs, and the dialog's key.
pub const COMMAND: &str = "addon.color.randomFill";
/// The seeds the dialog offers.
const SEEDS: u64 = 1_000_000;
/// The schemes the Colors choice offers: (`scheme`, label).
const SCHEMES: [(&str, &str); 3] = [("color", "Any Color"), ("tint", "Tints of a Swatch"), ("gray", "Grays")];
static SPEC: Spec = Spec { command: COMMAND, params, found: None };
fn percent(key: &str, label: &'static str, default: f64) -> Param {
Param::number(key, tl!(label), default, 1.0, 0).bounds(Some(0.0), Some(100.0)).unit(UnitKind::Percent).enabled_when_in("scheme", ["tint", "gray"])
}
/// The dialog's rows; the Swatch choice offers `swatches`.
fn rows(swatches: &[String]) -> Vec<Param> {
let schemes = SCHEMES.iter().map(|&(id, text)| (id.to_string(), tl!(text).into())).collect();
let swatches: Vec<(String, Label)> = swatches.iter().map(|name| (name.clone(), name.clone().into())).collect();
let first = swatches.first().map(|(id, _)| id.clone());
vec![
Param::new("scheme", tl!("Colors:"), ParamKind::choice(schemes, Some("color".into()))),
Param::new("swatch", tl!("Swatch:"), ParamKind::choice(swatches, first)).enabled_when("scheme", "tint"),
percent("min", "Minimum:", 0.0),
percent("max", "Maximum:", 100.0),
Param::new("seed", tl!("Seed:"), ParamKind::int(Some(0), Some(SEEDS as i64 - 1), 0)),
]
}
/// The command's params: the swatch only for tints, the minimum and maximum only for tints and grays.
fn params(fields: &DialogFields) -> Value {
let mut p = form::json_of(&rows(&[]), fields);
let scheme = fields.text("scheme").unwrap_or("color");
if scheme != "tint" {
p.remove("swatch");
}
if scheme == "color" {
p.remove("min");
p.remove("max");
}
Value::Object(p)
}
/// Why OK is off, if it is: a minimum above the maximum, or tints with no swatch to take them from.
fn refusal(fields: &DialogFields) -> Option<&'static str> {
let scheme = fields.text("scheme").unwrap_or("color");
if scheme == "tint" && fields.text("swatch").is_none_or(str::is_empty) {
return Some("Make a global or spot swatch first.");
}
let (min, max) = (fields.number("min").unwrap_or(0.0), fields.number("max").unwrap_or(100.0));
(scheme != "color" && min > max).then_some("The minimum is above the maximum.")
}
/// Opens the dialog on the active document: its global and spot swatches in the Swatch choice, and a new seed whenever
/// the document has changed, so running it again gives other colors while Preview and OK agree.
pub(crate) fn open(app: &mut VectorcraftApp) -> Result<Value, String> {
let st = app.session.active().ok_or("no document")?;
let swatches: Vec<String> = st.doc.swatches_iter().filter(|w| st.doc.global_color(&w.name).is_some()).map(|w| w.name.clone()).collect();
let mut opening = json!({ "scheme": "color", "min": 0, "max": 100, "seed": st.revision % SEEDS });
if let (Some(first), Some(o)) = (swatches.first(), opening.as_object_mut()) {
o.insert("swatch".into(), json!(first));
}
let rows = rows(&swatches);
let fields = form::fields_of(&rows, opening.as_object().ok_or("no params")?);
super::super::dialogs::open(app, &SPEC, fields, move |fields| {
let refused = refusal(fields);
let mut dialog =
ParamDialog::new(COMMAND, tl!("Randomize Fill Colors"), Cow::Owned(rows.clone())).previews(true).ok_enabled(refused.is_none());
if let Some(reason) = refused {
dialog = dialog.ok_reason(tl!(reason).into());
}
dialog.values(Bind::bound(fields))
})
}
#[cfg(test)]
mod tests;
@@ -0,0 +1,116 @@
use serde_json::json;
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::NodeId;
use vectorcraft_engine::Session;
use crate::addons::dialogs::tests::{self as host, open_item};
use crate::tests::panel_harness::Panel as Harness;
use crate::{VectorcraftApp, menus};
/// An app with a window, where its dialogs open, and two filled rectangles, both selected.
fn app() -> (VectorcraftApp, NodeId, NodeId) {
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
let mut rect = |x| NodeId(app.run("shape.rectangle", json!({"x": x, "y": 0, "width": 20, "height": 10})).unwrap()["id"].as_u64().unwrap());
let (a, b) = (rect(0), rect(100));
app.run("select.all", json!({})).unwrap();
(app, a, b)
}
fn fill(app: &VectorcraftApp, id: NodeId) -> Paint {
app.session.doc().unwrap().doc.node(id).unwrap().appearance.fill_paint()
}
fn open(app: &mut VectorcraftApp) {
open_item(app, "Color Effects", "Randomize Fill Colors…");
}
/// Replace a numeric field's text and commit by moving focus, without confirming the dialog.
fn type_number(panel: &mut Harness, label: &str, text: &str) {
panel.click(label);
panel.key(egui::Key::A, egui::Modifiers::COMMAND);
panel.type_text(text);
panel.key(egui::Key::Tab, egui::Modifiers::NONE);
panel.frame();
}
#[test]
fn the_menu_item_opens_the_dialog_on_its_command() {
let (mut app, a, b) = app();
let entries = menus::menu_entries(&app);
let item = entries.iter().find(|e| e.path == ["Object", "Plug-ins", "Color Effects"] && e.label == "Randomize Fill Colors…").unwrap();
assert_eq!(item.command.as_deref(), Some(super::COMMAND));
open(&mut app);
let id = host::dialog_id(&app);
let opened = host::read(&app, id, |f| (f.text("scheme").map(str::to_owned), f.number("min"), f.number("max")));
assert_eq!(opened, (Some("color".into()), Some(0.0), Some(100.0)));
// OK on the opening values: any color, each object its own.
assert!(host::confirm(&app, id));
host::frame(&mut app);
assert!(matches!(fill(&app, a), Paint::Solid { color: Color::Rgb { .. }, swatch: None, .. }), "{:?}", fill(&app, a));
assert_ne!(fill(&app, a), fill(&app, b));
}
#[test]
fn typed_grays_preview_run_on_ok_and_roll_back_on_cancel() {
let (app, a, b) = app();
let original = fill(&app, a);
let mut panel = Harness::new(app, crate::tests::picks::dialogs);
open(&mut panel.app());
let id = host::dialog_id(&panel.app());
host::set(&panel.app(), id, "scheme", json!("gray"));
panel.frame();
type_number(&mut panel, "Minimum", "80");
type_number(&mut panel, "Maximum", "20");
assert!(!panel.enabled("OK"), "a minimum above the maximum disables confirmation");
type_number(&mut panel, "Maximum", "80");
assert!(panel.enabled("OK"));
let undo = panel.app().session.doc().unwrap().history.undo.len();
panel.click("OK");
panel.frame();
let gray = Paint::solid(Color::gray(0.8));
{
let app = panel.app();
assert_eq!((fill(&app, a), fill(&app, b)), (gray.clone(), gray.clone()));
let history = &app.session.doc().unwrap().history;
assert_eq!(history.undo.len(), undo + 1, "one undo step");
assert_eq!(history.undo.last().unwrap().label, "Randomize Fill Colors");
}
// Typed values preview at once; Cancel puts the fills back.
open(&mut panel.app());
let id = host::dialog_id(&panel.app());
host::set(&panel.app(), id, "scheme", json!("gray"));
host::set(&panel.app(), id, "preview", json!(true));
panel.frame();
type_number(&mut panel, "Minimum", "25");
type_number(&mut panel, "Maximum", "25");
assert_eq!(fill(&panel.app(), a), Paint::solid(Color::gray(0.25)), "previewed");
panel.click("Cancel");
panel.frame();
let app = panel.app();
assert_eq!((fill(&app, a), fill(&app, b)), (gray.clone(), gray));
assert_ne!(fill(&app, a), original);
}
#[test]
fn tints_need_a_swatch_and_take_the_first_one() {
let (mut app, a, _) = app();
open(&mut app);
let id = host::dialog_id(&app);
host::set(&app, id, "scheme", json!("tint"));
assert!(!host::confirm(&app, id), "no global or spot swatch to tint");
host::cancel(&app, id);
host::frame(&mut app);
app.run("swatch.new", json!({"name": "Process", "color": "#336699"})).unwrap();
app.run("swatch.new", json!({"name": "Ink", "color": "#e01020", "spot": true})).unwrap();
open(&mut app);
let id = host::dialog_id(&app);
assert_eq!(host::read(&app, id, |f| f.text("swatch").map(str::to_owned)), Some("Ink".into()), "process swatches are not offered");
host::set(&app, id, "scheme", json!("tint"));
host::set(&app, id, "min", json!(30));
host::set(&app, id, "max", json!(30));
assert!(host::confirm(&app, id));
host::frame(&mut app);
let Paint::Solid { swatch, tint, .. } = fill(&app, a) else { panic!("not a solid fill") };
assert_eq!((swatch.as_deref(), tint), (Some("Ink"), 0.3));
}
+1
View File
@@ -107,6 +107,7 @@ pub(crate) fn open_from_menu(app: &mut VectorcraftApp, id: &str) -> Option<Resul
typetools::COMMAND => typetools::open,
color::legend::COMMAND => color::legend::open,
color::nearest::COMMAND => color::nearest::open,
color::random_fill::COMMAND => color::random_fill::open,
select::COMMAND => select::open,
_ => return super::arrange::open(app, id),
};
@@ -87,6 +87,13 @@ fn select_two_rects(app: &mut VectorcraftApp) {
app.run("select.all", json!({})).unwrap();
}
/// Two filled rectangles, both selected.
fn two_rects_filled() -> VectorcraftApp {
let mut app = two_rects();
app.run("paint.setFill", json!({"color": "#336699"})).unwrap();
app
}
fn two_drawings() -> VectorcraftApp {
let mut app = two_rects();
app.run("file.new", json!({"width": 700, "height": 500})).unwrap();
@@ -222,6 +229,20 @@ fn rows() -> Vec<Row> {
assert!(label.contains("#123456") && label.contains("C="), "{label}");
},
},
Row {
group: "Color Effects",
label: "Randomize Fill Colors…",
setup: two_rects_filled,
refused: || vec![("scheme", json!("gray")), ("min", json!(80)), ("max", json!(20))],
values: || vec![("min", json!(40)), ("max", json!(60))],
check: |app| {
for i in 0..2 {
let fill = app.session.doc().unwrap().doc.layers[0].children().unwrap()[i].appearance.fill_paint();
let Some(vectorcraft_color::Color::Gray { k }) = fill.color() else { panic!("not a gray: {fill:?}") };
assert!((0.4..=0.6).contains(&k), "{k}");
}
},
},
]
}
+25
View File
@@ -17264,6 +17264,31 @@ on the object or on one of its fills or strokes; a group carrying one is selecte
`grayImages` (images whose pixels are RGB, CMYK, or grayscale or 1-bit, read from the image's header). It returns the
`count` selected.
`addon.color.randomFill {scheme?, swatch?, min?, max?, seed?, ids?}` (Object › Plug-ins › Color Effects › Randomize
Fill Colors…) gives each selected filled path and compound path, and each one inside the selected groups and clipping
groups, a top fill color of its own, picked at random and evenly, as one undo step (none when no fill changes):
| `scheme` | Each fill becomes |
|---|---|
| `color` (the default) | A color with red, green and blue each at random, in the document's color mode |
| `tint` | A tint of `swatch`, a global or spot color swatch, linked to it, from `min` to `max` percent |
| `gray` | A gray from `min` to `max` percent black |
`min` and `max` are 0 to 100 (0 and 100 when left out) and go with `tint` and `gray` only; `swatch` goes with `tint`
only and is needed there (a tint swatch gives tints of its base). The same `seed` (a whole number, 0 when left out),
objects and settings give the same colors. Paths and compound paths with no fill, clipping paths (a compound path that
clips included), hidden and locked objects and the objects in hidden or locked groups and layers, type, images, symbol instances, blends and envelopes keep their fills; a gradient or pattern fill is replaced by
the color. On paths directly in a graph series whose fill changes, the graph stores the fill of the frontmost of them
for its next redraw, so after the redraw every mark of the series has that one color. It returns the
`count` of objects whose fill changed. An unknown scheme, `min` or `max` with `color`, `swatch` without `tint`, a
percent outside 0 to 100, `min` above `max`, a missing or process swatch and a seed that is not a whole number are
errors, and the document is left as it was. The dialog's seed starts new whenever the document has changed, and its
Swatch choice lists the document's global and spot swatches.
```json
{"name":"run_command","arguments":{"command":"addon.color.randomFill","params":{"scheme":"tint","swatch":"Ink","min":20,"max":80,"seed":7}}}
```
### Selection Tools
Selection Tools is a built-in add-on: its commands are `addon.select.*`, and in the desktop app it lives in Object ›
+5
View File
@@ -3126,6 +3126,11 @@ tints, curves, multiplied inks, skip spot), `duotone_*` and `cmd::addons::color:
params and RGB documents refused), and `the_duotone_dialog_has_a_row_per_tone_and_the_curve_of_one` and
`print_ink_fixes_opens_its_options_and_runs_on_ok` in `vectorcraft-ui-egui`. Commands: `docs/mcp.md` › Color Effects
add-on.
## Color Effects add-on: Randomize Fill Colors (2026-11-29)
A VectorCraft addition, so no area score moves. Object › Plug-ins › Color Effects › Randomize Fill Colors… gives each selected filled path and compound path, and each one inside the selected groups and clipping groups, its own top fill color, picked at random and evenly: any color in the document's color mode, a linked tint of a global or spot swatch, or a gray, the tints and grays between a minimum and a maximum percent. A seed repeats a result exactly, and the dialog starts with a new one whenever the document has changed. Paths without a fill, clipping paths, hidden and locked objects, type, images, symbol instances, blends and envelopes keep their fills. One undo step, none when no fill changes; bad params are refused without a change. Tests: `cmd::addons::color::random_fill::tests` in `vectorcraft-engine` (each scheme and its range, the seed, groups, compound paths and clipping groups entered, unfilled, hidden and locked objects left alone, CMYK documents, one undo step or none, bad params refused), `addons::color::random_fill::tests` and the add-on dialog family test in `vectorcraft-ui-egui` (typed values preview, OK and Cancel, the Swatch choice), and `command_sweep`. Commands: `docs/mcp.md` › Color Effects add-on.
## Arrange Tools add-on (2026-10-31)
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Arrange Tools: Arrange in
+1
View File
@@ -595,6 +595,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
| Artwork Cleanup add-on text tools (VectorCraft addition): the panel's Text row, which the panel can hide, and Object › Plug-ins › Artwork Cleanup set the alignment of point type keeping its place, break type into lines (Shift-click: paragraphs), words or glyphs, split type at the cursor, reset a text transform (Alt-click: and its horizontal scale), combine point type, remove line or paragraph breaks and replace missing fonts, each one undo step | done | `addon.cleanup.*` text commands, `crates/ui-egui/src/addons/cleanup.rs` and its tests; a VectorCraft addition, so it is not scored |
| Color Effects add-on (VectorCraft addition): live Exposure, Desaturate and Invert Colors in Effect › Color Effects and Object › Plug-ins › Color Effects; its panel picks a colour adjustment and its values and adds it as a live effect or applies it as a filter, into the colours, as one undo step; Select by Color Kind selects the objects that use spot colours, carry colour effects, or are RGB, CMYK or grayscale images; Vector Halftone draws an object as halftone dots live (the dots Object › Vector Halftone makes), which Expand Appearance and the exporters write as paths; Duotone prints each colour's tone with one to four inks (a tint of a spot tone's swatch, or the CMYK mix of several), live or as a filter, its dialog a row per tone and the picked tone's curve; Print Ink Fixes (a CMYK document's ink limit, white overprint removed, black overprint set) opens its options from the submenu and the panel's Inks | done | `addon.color.*`, `crates/ui-egui/src/addons/color.rs` and its tests; not a feature of the reference app, so it is not scored |
| Color Effects add-on (VectorCraft addition): Object › Plug-ins › Color Effects › Find Nearest Swatch… picks a Library (Document Swatches, a built-in library, or a library or colour book the user saved or loaded) and Fill and Stroke, lists each colour of the selection with its three closest swatches (chip, name, ΔE 2000), and Apply gives each colour its nearest swatch (global and spot swatches linked; a library's swatches added to the document first), one undo step | done | #4923; `addon.color.nearestSwatch`, `addon.color.applyNearestSwatch`, `crates/engine/src/cmd/addons/color/nearest.rs`, `crates/ui-egui/src/addons/color/nearest.rs` and their tests; not a feature of the reference app, so it is not scored |
| Color Effects add-on (VectorCraft addition): Object › Plug-ins › Color Effects › Randomize Fill Colors… picks Colors (Any Color, Tints of a Swatch or Grays), a Swatch among the document's global and spot swatches, Minimum and Maximum (%) and a Seed, with Preview, and gives each selected filled path and compound path, inside groups too, its own fill color at random, one undo step | done | `addon.color.randomFill`, `crates/engine/src/cmd/addons/color/random_fill.rs`, `crates/ui-egui/src/addons/color/random_fill.rs` and their tests; a VectorCraft addition, so it is not scored |
| Selection Tools add-on (VectorCraft addition): Object › Plug-ins › Selection Tools › Select by Artboards… lists every artboard (number, name, width × height in the document's units), filters them by name, chooses several (click, Shift-click for a range, Cmd/Ctrl-click to toggle; Select All / None act on the rows shown; a count of those chosen), fits a row's artboard in the window on double-click and makes it active, and on OK selects the objects overlapping, fully inside or fully outside the chosen artboards (Overlapping is All on Active Artboard's test) | done | #5525, #5548, #5549; `addon.select.byArtboards`, `crates/engine/src/cmd/addons/select.rs`, `crates/ui-egui/src/addons/select.rs` and their tests; not a feature of the reference app |
| Selection Tools add-on (VectorCraft addition): Select Linked, Select Embedded, Select Missing and Select Modified in Object › Plug-ins › Selection Tools and the Links panel menu (off when no image has that status; Shift adds to the selection) select the images and placed documents with that link status, leaving out hidden, locked, template-layer and outside-isolation ones, which the status bar counts (e.g. "Selected 9 missing images; 3 more are hidden or locked"); Select by Link Status… lists them with name, status and format, searches by name, filters by status, picks with checkboxes and All / None, and selects with Zoom to Selection on by default | done | #5526; `addon.select.byLinkStatus`, `crates/engine/src/cmd/addons/select.rs`, `crates/ui-egui/src/addons/select/link_status.rs` and their tests; not a feature of the reference app |
| Style panels: a double-click on a user character style's row opens its Character Style Options, and on a paragraph style's row opens the same Paragraph Style Options as the panel menu, with General, Basic Paragraph Formats, Tabs, Composition, Hyphenation, Justification and East Asian Composition Settings; the Character Style Options dialog keeps a fixed width, its sections scrolling when the window is shorter so OK and Cancel stay on screen | done | `ui.charStyleOptions`, `ui.paraStyleOptions` (`paraStyle.edit`); `panels::text_styles::tests::double_clicking_a_character_style_row_opens_its_options`, `dialogs::char_style_options::tests::the_sections_scroll_in_a_window_shorter_than_the_general_list`, `dialogs::para_style_options::tests::every_section_draws_its_fields`, `dialogs::para_style_options::tests::tabs_section_edits_the_style_stops` |