mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-31 13:17:19 -06:00
M3.59: tints of global and spot colours, tint swatches and Global colour balance
A colour linked to a global or spot swatch keeps a tint (Paint::Solid.tint, 1 by default and
left out of files at 100 %): paint.setFill/setStroke {swatch, tint} apply the swatch at that
percentage, swatch edits recolour every linked colour at its own tint, and Color::tinted
resolves it (CMYK and Gray inks scale, RGB mixes toward white). swatch.new saves a tint as a
tint swatch ("Ink 40%") linked to its base. Spot tints separate as that percentage of their
plate (Separations Preview, PDF Separation value) instead of an ink-ratio guess. Adjust Color
Balance's Global mode (tint) shifts the tints of linked colours. The Color panel shows Tint
mode (the swatch chip, its name and a T slider) for linked colours; the Swatches panel
highlights the tint swatch in use. Gradient stops get the same link and tint fields (the
swatch walks cover them), so GradientStop is no longer Copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e94748dc17
commit
b2ececc7b4
@@ -107,7 +107,10 @@ fn add_used_colors_skips_colours_that_have_swatches() {
|
||||
run(&mut s, "select.set", json!({"ids": [d.0]}));
|
||||
let r = run(&mut s, "swatch.addUsedColors", json!({"selection": true, "global": true}));
|
||||
assert_eq!(r, json!({"added": ["R=171 G=205 B=239"], "linked": 1}));
|
||||
assert_eq!(fill(&s, d), Paint::Solid { color: vectorcraft_color::Color::from_hex("#abcdef").unwrap(), swatch: Some("R=171 G=205 B=239".into()) });
|
||||
assert_eq!(
|
||||
fill(&s, d),
|
||||
Paint::Solid { color: vectorcraft_color::Color::from_hex("#abcdef").unwrap(), swatch: Some("R=171 G=205 B=239".into()), tint: 1.0 }
|
||||
);
|
||||
assert!(doc(&s).swatch("R=171 G=205 B=239").unwrap().global);
|
||||
}
|
||||
|
||||
@@ -151,7 +154,7 @@ fn merge_keeps_the_first_and_relinks_the_others_art() {
|
||||
let r = run(&mut s, "swatch.merge", json!({"names": ["Red", "Orange"]}));
|
||||
assert_eq!(r, json!({"name": "Red", "merged": ["Orange"], "relinked": 1}));
|
||||
assert!(doc(&s).swatch("Orange").is_none());
|
||||
assert_eq!(fill(&s, b), Paint::Solid { color: red, swatch: Some("Red".into()) });
|
||||
assert_eq!(fill(&s, b), Paint::Solid { color: red, swatch: Some("Red".into()), tint: 1.0 });
|
||||
assert_eq!(undo_len(&s), undo + 1);
|
||||
run(&mut s, "edit.undo", json!({}));
|
||||
assert_eq!(*doc(&s), before);
|
||||
|
||||
Reference in New Issue
Block a user