Swatches: Color Group Options renames the selected color group

The Swatches panel menu gets Color Group Options..., available when one
color group is the whole panel selection. Its dialog shows the group's
name, and OK renames the group with the new swatch.renameGroup command
(ui.colorGroupOptions opens the dialog). The group's swatches, their
colors and the art linked to them stay as they are, and the group stays
selected in the panel under its new name.

The name is trimmed. An empty name, or a name another color group or a
swatch has, is an error and keeps the dialog open. A rename is one undo
step; the group's own name records none. Double-clicking a group's
folder and the options button still open Edit or Apply Color Group.

The Color Guide's spot color base follows a group renamed in a batch,
so deleting the group under its new name ends the link.

Help page: https://helpx.adobe.com/illustrator/desktop/manage-colors/learn-color-basics/create-color-groups-in-the-color-guide-panel.html
This commit is contained in:
dotCooCoo
2026-11-17 14:05:35 -08:00
parent ee60c51fd9
commit 226847f65f
45 changed files with 413 additions and 8 deletions
@@ -591,6 +591,7 @@ pub(super) const ALLOWED: &[&str] = &[
"swatch.move",
"swatch.new",
"swatch.newGroup",
"swatch.renameGroup",
"swatch.resetDefaults",
"swatch.setSpot",
"swatch.sortByKind",
+37 -1
View File
@@ -9,7 +9,9 @@ use vectorcraft_doc::swatches::{LinkFn, PaintFn, color_name, map_node_paints, ma
use vectorcraft_doc::{Document, NodeId};
use super::paint::paint_from;
use super::{CommandSpec, Result, Session, bad, bool_or, check_numbers, check_switches, cmd, color_value, has_doc, index, ok, str_param, switch_or};
use super::{
CommandSpec, Result, Session, bad, bool_or, check_numbers, check_switches, cmd, color_value, has_doc, index, ok, str_param, switch_or, text_param,
};
use crate::EngineError;
pub fn specs() -> Vec<CommandSpec> {
@@ -106,6 +108,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_doc,
swatch_ungroup
),
cmd!(
"swatch.renameGroup",
"Color Group Options",
["Window", "Swatches"],
None,
"{group: color group, name: its new name (trimmed)} rename a color group, as one undo step; its swatches, their colors and the art linked to them stay as they are. Swatches and color groups share one set of names, so a name another color group or a swatch has is an error, as is an empty name; the group's own name records no undo step → {name}",
has_doc,
swatch_rename_group
),
cmd!(
"swatch.sortByKind",
"Sort by Kind",
@@ -1200,6 +1211,31 @@ fn swatch_ungroup(s: &mut Session, p: &Value) -> Result<Value> {
Ok(json!({ "swatches": moved }))
}
fn swatch_rename_group(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "swatch.renameGroup";
let group = text_param(p, "group", C)?.ok_or_else(|| bad(C, "missing `group`"))?.to_string();
let name = text_param(p, "name", C)?.ok_or_else(|| bad(C, "missing `name`"))?.trim().to_string();
if name.is_empty() {
return Err(bad(C, "`name` is empty"));
}
let d = &s.doc()?.doc;
if !d.swatch_groups.iter().any(|g| g.name == group) {
return Err(bad(C, format!("no colour group `{group}`")));
}
if name == group {
return Ok(json!({ "name": name }));
}
if d.swatch_name_taken(&name) {
return Err(bad(C, format!("a swatch or color group named `{name}` already exists")));
}
s.edit("Color Group Options", |d, _| {
let g = d.swatch_groups.iter_mut().find(|g| g.name == group).ok_or_else(|| bad(C, format!("no colour group `{group}`")))?;
g.name.clone_from(&name);
Ok(())
})?;
Ok(json!({ "name": name }))
}
fn swatch_sort_by_kind(s: &mut Session, _: &Value) -> Result<Value> {
let rank = |w: &Swatch| match &w.paint {
Paint::None => 0,
+48
View File
@@ -504,6 +504,54 @@ fn ungroup_and_sort_by_kind_are_one_undo_step_each() {
assert_eq!(n[n.iter().position(|x| x == "Orange").unwrap() + 1], "Ocean", "the spot colour comes after the process ones, then the gradients");
}
/// Color Group Options renames a color group alone, as one undo step: its swatches, their colors
/// and the art linked to them stay as they are. A name another group or a swatch has, an empty
/// name and a parameter that is missing or not a string are errors that change nothing, and the
/// group's own name records no undo step.
#[test]
fn rename_group_renames_only_the_group_in_one_undo_step() {
let mut s = session();
run(&mut s, "swatch.edit", json!({"name": "Bright Red", "global": true}));
let a = rect_filled(&mut s, json!({"swatch": "Bright Red"}));
let linked = fill(&s, a);
let members = names(&s, Some("Brights"));
let before = doc(&s).clone();
let undo = undo_len(&s);
assert_eq!(run(&mut s, "swatch.renameGroup", json!({"group": "Brights", "name": " Vivid Colors "}))["name"], "Vivid Colors");
assert!(doc(&s).swatch_groups.iter().all(|g| g.name != "Brights"));
assert_eq!(names(&s, Some("Vivid Colors")), members);
assert_eq!(fill(&s, a), linked, "linked art keeps its swatch and color");
assert_eq!(undo_len(&s), undo + 1);
run(&mut s, "edit.undo", json!({}));
assert_eq!(*doc(&s), before);
run(&mut s, "edit.redo", json!({}));
assert_eq!(names(&s, Some("Vivid Colors")), members);
let renamed = doc(&s).clone();
// The group's own name, trimmed, changes nothing.
assert_eq!(run(&mut s, "swatch.renameGroup", json!({"group": "Vivid Colors", "name": " Vivid Colors"}))["name"], "Vivid Colors");
assert_eq!(undo_len(&s), undo + 1);
let refused = [
json!({"group": "Vivid Colors", "name": "Grays"}),
json!({"group": "Vivid Colors", "name": "White"}),
json!({"group": "Vivid Colors", "name": "[None]"}),
json!({"group": "Vivid Colors", "name": "[Registration]"}),
json!({"group": "Vivid Colors", "name": ""}),
json!({"group": "Vivid Colors", "name": " "}),
json!({"group": "Vivid Colors"}),
json!({"group": "Vivid Colors", "name": null}),
json!({"group": "Vivid Colors", "name": 5}),
json!({"name": "Bold"}),
json!({"group": 5, "name": "Bold"}),
json!({"group": "Nope", "name": "Bold"}),
json!({"group": "White", "name": "Bold"}),
];
for p in refused {
assert!(s.execute("swatch.renameGroup", &p).is_err(), "{p}");
assert_eq!(*doc(&s), renamed, "{p}");
assert_eq!(undo_len(&s), undo + 1, "{p}");
}
}
#[test]
fn a_cmyk_document_starts_with_cmyk_swatches_and_stores_new_colours_as_cmyk() {
use vectorcraft_color::Color;
+6
View File
@@ -903,6 +903,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{swatches?: [names]} open New Color Group, from those swatches or the selected artwork (dialog `newColorGroup`, engine: swatch.newGroup)",
),
(
"ui.colorGroupOptions",
"Color Group Options…",
"",
"{group} open Color Group Options for that color group (dialog `colorGroupOptions`, field `name`): OK renames the group (engine: swatch.renameGroup); a name that is empty or that another color group or a swatch has keeps the dialog open",
),
(
"ui.colorPicker",
"Color Picker…",
+4
View File
@@ -270,6 +270,10 @@ impl VectorcraftApp {
}
// A renamed spot color swatch stays the Color Guide's base; a deleted one ends the link.
panels::color_guide::after_command(self, id, &params, v, spot_base);
// A renamed color group stays selected in the Swatches panel.
if let Some(ctx) = self.ui_ctx.clone() {
panels::swatches::after_command(&ctx, id, &params, v);
}
if id == "file.new" {
self.ui.status.clear();
// New Document's Pixel preview mode (Overprint Preview is the engine's).
+2
View File
@@ -24,6 +24,7 @@ pub mod bullets_numbering;
pub mod char_style_options;
pub mod check_spelling;
pub mod color_balance;
pub mod color_group_options;
pub mod color_guide_options;
mod color_picker;
mod command;
@@ -345,6 +346,7 @@ registry! {
ResetActions: [confirm::RESET_ACTIONS] => confirm::RESET_ACTIONS_SPEC,
NewSwatch: [new_swatch::KIND] => new_swatch::SPEC,
NewColorGroup: [new_color_group::KIND] => new_color_group::SPEC,
ColorGroupOptions: [color_group_options::KIND] => color_group_options::SPEC,
GraphData: [graph_data::KIND] => graph_data::SPEC,
GraphDesign: [graph_design::DESIGN] => graph_design::DESIGN_SPEC,
GraphColumn: [graph_design::COLUMN] => graph_design::COLUMN_SPEC,
@@ -0,0 +1,115 @@
//! Color Group Options: the name of a color group in the Swatches panel. OK renames the group
//! (`swatch.renameGroup`) and keeps it selected in the panel; its swatches and their colors stay
//! as they are.
//!
//! Fields: `name` and `__group` (the group being renamed).
use serde_json::{Value, json};
use super::swatch_options::{grid, label};
use super::{DialogSpec, form};
use crate::VectorcraftApp;
use crate::state::Dialog;
/// The dialog kind of Color Group Options.
pub const KIND: &str = "colorGroupOptions";
pub(super) const SPEC: DialogSpec =
DialogSpec { heading: |_| tl!("Color Group Options").into(), body, confirm, min_width: 320.0, ..DialogSpec::FORM };
/// `ui.colorGroupOptions {group}`: open Color Group Options for color group `group`.
pub fn open(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
let key = "group";
let group = match p.get(key) {
Some(Value::String(g)) => g.as_str(),
None | Some(Value::Null) => return Err("missing `group`".into()),
Some(_) => return Err(format!("`{key}` must be a string")),
};
let d = &app.session.active().ok_or("no document open")?.doc;
let name = d.swatch_groups.iter().find(|g| g.name == group).ok_or_else(|| format!("no colour group `{group}`"))?.name.clone();
app.ui.dialog = Some(Dialog::new(KIND, json!({ "name": name, "__group": name })));
Ok(Value::Null)
}
fn body(_: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
grid(ui, |ui| {
label(ui, tl!("Name:"));
form::text(ui, d, "name", 190.0);
ui.end_row();
});
false
}
/// OK: rename the group (the Swatches panel keeps it selected, [`crate::panels::swatches::after_command`]).
/// A name that is empty or that another group or a swatch has keeps the dialog open.
fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
let r = app.run("swatch.renameGroup", json!({ "group": d.str("__group"), "name": d.str("name") }));
if r.is_ok() {
app.ui.dialog = None;
}
r
}
#[cfg(test)]
mod tests {
use super::*;
use vectorcraft_engine::Session;
fn app() -> VectorcraftApp {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 200, "height": 200})).unwrap();
app
}
fn set(app: &mut VectorcraftApp, v: &str) {
app.ui.dialog.as_mut().unwrap().fields.insert("name".into(), json!(v));
}
fn groups(app: &VectorcraftApp) -> Vec<String> {
app.session.active().unwrap().doc.swatch_groups.iter().map(|g| g.name.clone()).collect()
}
fn undo_len(app: &VectorcraftApp) -> usize {
app.session.active().unwrap().history.undo.len()
}
/// The dialog opens on the group's name; OK renames it in one undo step, a taken or empty name
/// keeps the dialog open with nothing changed, Cancel changes nothing, and OK with the name
/// unchanged records no undo step.
#[test]
fn renames_the_group_and_keeps_a_refused_name_open() {
let mut app = app();
app.run("ui.colorGroupOptions", json!({"group": "Brights"})).unwrap();
let d = app.ui.dialog.as_ref().unwrap();
assert_eq!((d.kind.as_str(), d.str("name").as_str(), d.str("__group").as_str()), (KIND, "Brights", "Brights"));
// Drawn headlessly in the shared frame.
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let mut out = ctx.run_ui(Default::default(), |ui| super::super::show(&mut app, ui.ctx()));
out.textures_delta.clear();
let undo = undo_len(&app);
for taken in ["Grays", "White", " "] {
set(&mut app, taken);
assert!(super::super::confirm(&mut app).is_err(), "{taken:?}");
assert!(app.ui.dialog.is_some(), "{taken:?} keeps the dialog open");
assert_eq!(undo_len(&app), undo, "{taken:?}");
}
set(&mut app, "Vivid");
super::super::cancel(&mut app);
assert!(app.ui.dialog.is_none() && groups(&app).contains(&"Brights".to_string()), "Cancel keeps the name");
assert_eq!(undo_len(&app), undo);
app.run("ui.colorGroupOptions", json!({"group": "Brights"})).unwrap();
super::super::confirm(&mut app).unwrap();
assert!(app.ui.dialog.is_none());
assert_eq!(undo_len(&app), undo, "the same name records no undo step");
app.run("ui.colorGroupOptions", json!({"group": "Brights"})).unwrap();
set(&mut app, "Vivid");
super::super::confirm(&mut app).unwrap();
assert!(app.ui.dialog.is_none() && groups(&app).contains(&"Vivid".to_string()));
assert_eq!(undo_len(&app), undo + 1);
assert!(app.run("ui.colorGroupOptions", json!({"group": "Brights"})).is_err());
assert!(app.run("ui.colorGroupOptions", json!({"group": "White"})).is_err(), "a swatch is not a group");
assert!(app.run("ui.colorGroupOptions", json!({})).is_err());
assert!(app.run("ui.colorGroupOptions", json!({"group": 5})).is_err());
}
}
+2
View File
@@ -3969,6 +3969,8 @@ digits Malayalam Малаялам
Unembed… Премахване на връзка…
Ungroup Разгрупиране
Ungroup Color Group Разгрупиране на цветова група
Color Group Options Опции за цветова група
Color Group Options… Опции за цветова група…
Unicode Уникод
Unicode (UTF-16) Уникод (UTF-16)
Unicode (UTF-8) Уникод (UTF-8)
Can't render this file because it is too large.
+2
View File
@@ -4165,6 +4165,8 @@ theme Appearance Izgled
Spot Colors (0) Spot boje (0)
Swatch Options Opcije uzorka boje
Ungroup Color Group Razgrupiši grupu boja
Color Group Options Opcije grupe boja
Color Group Options… Opcije grupe boja…
Copy to User Defined Kopiraj u korisnički definisano
Swatch Library Biblioteka uzoraka boja
Clear All Tabs Očisti sve tabulatore
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5
View File
@@ -5183,6 +5183,8 @@ digits Malayalam Malaiàlam
Unembed… Desincrusta…
Ungroup Desagrupa
Ungroup Color Group Desagrupa el grup de colors
Color Group Options Opcions del grup de colors
Color Group Options… Opcions del grup de colors…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -5637,6 +5639,9 @@ digits Malayalam Malaiàlam
@msg a freeform gradient keeps at least one point un degradat de forma lliure conserva com a mínim un punt
@msg a gradient needs at least two stops un degradat necessita com a mínim dues parades
@msg a graphic style named `{to}` already exists ja existeix un estil gràfic anomenat `{to}`
@msg a swatch or color group named `{name}` already exists ja existeix una mostra o un grup de colors anomenat `{name}`
@msg missing `group` falta `group`
@msg no colour group `{group}` no hi ha el grup de colors `{group}`
@msg a key object sits on that point hi ha un objecte clau en aquest punt
@msg a layer couldn't be read no s’ha pogut llegir una capa
@msg a linked image can't become a gradient mesh: embed it first una imatge enllaçada no pot esdevenir una malla de degradat: incrusteu-la primer
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -4269,6 +4269,8 @@ theme Appearance Motiv
Spot Colors (0) Přímé barvy (0)
Swatch Options Možnosti položky vzorníku
Ungroup Color Group Zrušit skupinu barev
Color Group Options Možnosti skupiny barev
Color Group Options… Možnosti skupiny barev…
Copy to User Defined Kopírovat do uživatelských
Swatch Library Knihovna vzorníku
Clear All Tabs Vymazat všechny tabulátory
@@ -5184,6 +5186,7 @@ liquify-list-end {0}, {1} {0} a {1}
@msg a freeform gradient keeps at least one point volný přechod si ponechává alespoň jeden bod
@msg a gradient needs at least two stops přechod potřebuje alespoň dvě zarážky
@msg a graphic style named `{to}` already exists grafický styl s názvem `{to}` už existuje
@msg a swatch or color group named `{name}` already exists položka vzorníku nebo skupina barev s názvem `{name}` už existuje
@msg a key object sits on that point na tomto bodě leží klíčový objekt
@msg a page is missing chybí stránka
@msg a page out of range stránka mimo rozsah
Can't render this file because it is too large.
+3
View File
@@ -6677,6 +6677,8 @@ theme Appearance Udseende
Spot Colors (0) Spotfarver (0)
Swatch Options Indstillinger for farveprøve
Ungroup Color Group Afgruppér farvegruppe
Color Group Options Indstillinger for farvegruppe
Color Group Options… Indstillinger for farvegruppe…
Copy to User Defined Kopiér til brugerdefinerede
Swatch Library Farveprøvebibliotek
Clear All Tabs Ryd alle tabulatorer
@@ -7400,6 +7402,7 @@ imageTrace Outline Kontur
@msg a freeform gradient keeps at least one point en freeform-gradient bevarer mindst ét punkt
@msg a gradient needs at least two stops en gradient skal have mindst to stop
@msg a graphic style named `{to}` already exists der findes allerede en grafikstil med navnet `{to}`
@msg a swatch or color group named `{name}` already exists der findes allerede en farveprøve eller farvegruppe med navnet `{name}`
@msg a page is missing en side mangler
@msg a page out of range en side uden for området
@msg a page tree kid isn't a reference et barn i sidetræet er ikke en reference
Can't render this file because it is too large.
+3
View File
@@ -4064,6 +4064,8 @@ effect Points Punkte
Unembed… Einbettung aufheben…
Ungroup Gruppierung aufheben
Ungroup Color Group Farbgruppe auflösen
Color Group Options Farbgruppenoptionen
Color Group Options… Farbgruppenoptionen…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4785,6 +4787,7 @@ liquify-list-end {0}, {1} {0} und {1}
@msg a freeform gradient keeps at least one point ein Freiformverlauf behält mindestens einen Punkt
@msg a gradient needs at least two stops ein Verlauf braucht mindestens zwei Farbstopps
@msg a graphic style named `{to}` already exists ein Grafikstil namens `{to}` ist bereits vorhanden
@msg a swatch or color group named `{name}` already exists ein Farbfeld oder eine Farbgruppe namens `{name}` ist bereits vorhanden
@msg a key object sits on that point auf diesem Punkt liegt ein Basisobjekt
@msg a page is missing eine Seite fehlt
@msg a page out of range eine Seite außerhalb des Bereichs
Can't render this file because it is too large.
+5
View File
@@ -4626,6 +4626,8 @@ digits Malayalam Μαλαγιάλαμ
Unembedded to {} Καταργήθηκε η ενσωμάτωση στο {}
Unembed… Κατάργηση ενσωμάτωσης…
Ungroup Color Group Κατάργηση ομαδοποίησης χρωμάτων
Color Group Options Επιλογές ομάδας χρωμάτων
Color Group Options… Επιλογές ομάδας χρωμάτων…
Unique Μοναδικό
Unite Ένωση
Unite and Simplify Ένωση και απλοποίηση
@@ -4850,6 +4852,9 @@ digits Malayalam Μαλαγιάλαμ
@msg a freeform gradient keeps at least one point το ντεγκραντέ ελεύθερης μορφής χρειάζεται τουλάχιστον ένα σημείο
@msg a gradient needs at least two stops το ντεγκραντέ χρειάζεται τουλάχιστον δύο σημεία χρώματος
@msg a graphic style named `{to}` already exists υπάρχει ήδη στυλ γραφικών με όνομα `{to}`
@msg a swatch or color group named `{name}` already exists υπάρχει ήδη δείγμα χρώματος ή ομάδα χρωμάτων με όνομα `{name}`
@msg missing `group` λείπει το `group`
@msg no colour group `{group}` δεν υπάρχει ομάδα χρωμάτων `{group}`
@msg a key object sits on that point σε αυτό το σημείο βρίσκεται βασικό αντικείμενο
@msg a page is missing λείπει μια σελίδα
@msg a page out of range η σελίδα βρίσκεται εκτός εύρους
Can't render this file because it is too large.
+5
View File
@@ -4114,6 +4114,8 @@ digits Malayalam Malayálam
Unembed… Desincrustar…
Ungroup Desagrupar
Ungroup Color Group Desagrupar grupo de colores
Color Group Options Opciones de grupo de colores
Color Group Options… Opciones de grupo de colores…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4889,6 +4891,9 @@ liquify-list-end {0}, {1} {0}, {1}
@msg a freeform gradient keeps at least one point un degradado de forma libre conserva al menos un punto
@msg a gradient needs at least two stops un degradado necesita al menos dos paradas
@msg a graphic style named `{to}` already exists ya existe un estilo gráfico llamado `{to}`
@msg a swatch or color group named `{name}` already exists ya existe una muestra o un grupo de colores llamado `{name}`
@msg missing `group` falta `group`
@msg no colour group `{group}` no existe el grupo de colores `{group}`
@msg a key object sits on that point hay un objeto clave en ese punto
@msg a page is missing falta una página
@msg a page out of range una página fuera de rango
Can't render this file because it contains an unexpected character in line 2 and column 73.
+5
View File
@@ -4193,6 +4193,8 @@ theme Appearance Ulkoasu
Spot Colors (0) Spottivärit (0)
Swatch Options Värimallin asetukset
Ungroup Color Group Pura väriryhmä
Color Group Options Väriryhmän asetukset
Color Group Options… Väriryhmän asetukset…
Copy to User Defined Kopioi käyttäjän määrittämiin
Swatch Library Värimallikirjasto
Clear All Tabs Tyhjennä kaikki sarkaimet
@@ -5120,6 +5122,9 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg a freeform gradient keeps at least one point vapaamuotoisessa liukuvärissä on oltava vähintään yksi piste
@msg a gradient needs at least two stops liukuvärissä on oltava vähintään kaksi väripistettä
@msg a graphic style named `{to}` already exists grafiikkatyyli nimeltä `{to}` on jo olemassa
@msg a swatch or color group named `{name}` already exists värimalli tai väriryhmä nimeltä `{name}` on jo olemassa
@msg missing `group` `group` puuttuu
@msg no colour group `{group}` ei väriryhmää `{group}`
@msg a key object sits on that point pisteessä on avainobjekti
@msg a page is missing sivu puuttuu
@msg a page out of range sivu alueen ulkopuolella
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -4101,6 +4101,8 @@ digits Malayalam Malayalam
Unembed… Annuler l’incorporation…
Ungroup Dissocier
Ungroup Color Group Dissocier le groupe de couleurs
Color Group Options Options du groupe de couleurs
Color Group Options… Options du groupe de couleurs…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4851,6 +4853,7 @@ liquify-list-end {0}, {1} {0} et {1}
@msg a freeform gradient keeps at least one point un dégradé de forme libre garde au moins un point
@msg a gradient needs at least two stops un dégradé doit avoir au moins deux étapes de dégradé
@msg a graphic style named `{to}` already exists un style graphique nommé `{to}` existe déjà
@msg a swatch or color group named `{name}` already exists une nuance ou un groupe de couleurs nommé `{name}` existe déjà
@msg a key object sits on that point un objet clé se trouve sur ce point
@msg a page is missing une page est manquante
@msg a page out of range une page hors limites
Can't render this file because it is too large.
+2
View File
@@ -4214,6 +4214,8 @@
Unembed… એમ્બેડ દૂર કરો…
Ungroup અનગ્રુપ કરો
Ungroup Color Group રંગ ગ્રુપ અનગ્રુપ કરો
Color Group Options રંગ ગ્રુપ વિકલ્પો
Color Group Options… રંગ ગ્રુપ વિકલ્પો…
Uniform યુનિફોર્મ
Uniformly Scaled સમાન રીતે સ્કેલ કરેલ
Unite યુનાઇટ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+3
View File
@@ -5591,6 +5591,8 @@ antiAlias Sharp शार्प
Unembedded to {} एम्बेड हटाकर {} में रखा गया
Ungroup समूह तोड़ें
Ungroup Color Group रंग समूह का ग्रूपिंग हटाएँ
Color Group Options रंग समूह ऑप्शन्स
Color Group Options… रंग समूह ऑप्शन्स…
Unicode यूनिकोड
Unicode (UTF-16) यूनिकोड (UTF-16)
Unicode (UTF-8) यूनिकोड (UTF-8)
@@ -6580,6 +6582,7 @@ antiAlias Sharp शार्प
@msg a graph has at most {_1} series, so it transposes with at most that many categories एक ग्राफ में सबसे {_1} श्रृंखला है, इसलिए यह उस कई श्रेणियों के साथ ट्रांसपोजित होता है।
@msg a graph's records don't end where they should: its art was read as it is एक ग्राफ का रिकॉर्ड अंत नहीं है जहां उन्हें होना चाहिए: इसकी कला को पढ़ा गया क्योंकि यह है
@msg a graphic style named `{to}` already exists `{to}` नामक एक ग्राफिक स्टाइल पहले से मौजूद है
@msg a swatch or color group named `{name}` already exists `{name}` नामक एक स्वॉच या रंग समूह पहले से मौजूद है
@msg a group crosses a multi-layer mask एक समूह एक बहुलेयर मास्क पार करता है
@msg a key object sits on that point एक प्रमुख ऑब्जेक्ट उस बिंदु पर बैठती है
@msg a layer can't be merged into its own sublayer एक लेयर को अपने खुद के सबलेयर में विलय नहीं किया जा सकता है
Can't render this file because it is too large.
+3
View File
@@ -4849,6 +4849,8 @@ mark-style Japanese Japán
Unembed… Beágyazás megszüntetése…
Ungroup Csoportbontás
Ungroup Color Group Színcsoport bontása
Color Group Options Színcsoport beállításai
Color Group Options… Színcsoport beállításai…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -5230,6 +5232,7 @@ imageTrace Outline Körvonal
@msg a freeform gradient keeps at least one point a szabad formájú színátmenetben legalább egy pont marad
@msg a gradient needs at least two stops a színátmenethez legalább két színátmenet-pont kell
@msg a graphic style named `{to}` already exists már van ilyen nevű grafikai stílus: `{to}`
@msg a swatch or color group named `{name}` already exists már van ilyen nevű színminta vagy színcsoport: `{name}`
@msg a key object sits on that point ezen a ponton kulcsobjektum van
@msg a layer couldn't be read egy réteg nem olvasható
@msg a page is missing hiányzik egy oldal
Can't render this file because it is too large.
+2
View File
@@ -3929,6 +3929,8 @@ theme Appearance Tampilan
Spot Colors (0) Warna spot (0)
Swatch Options Opsi sampel
Ungroup Color Group Lepaskan grup warna
Color Group Options Opsi grup warna
Color Group Options… Opsi grup warna…
Copy to User Defined Salin ke Buatan Pengguna
Swatch Library Pustaka sampel
Clear All Tabs Hapus semua tab
Can't render this file because it contains an unexpected character in line 2511 and column 5.
+3
View File
@@ -4163,6 +4163,8 @@ digits Malayalam Malayalam
Unembed… Rimuovi incorporamento…
Ungroup Separa
Ungroup Color Group Separa gruppo colori
Color Group Options Opzioni gruppo colori
Color Group Options… Opzioni gruppo colori…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4919,6 +4921,7 @@ liquify-list-end {0}, {1} {0} e {1}
@msg a freeform gradient keeps at least one point una sfumatura a forma libera mantiene almeno un punto
@msg a gradient needs at least two stops una sfumatura richiede almeno due cursori colore
@msg a graphic style named `{to}` already exists esiste già uno stile grafico denominato `{to}`
@msg a swatch or color group named `{name}` already exists esiste già un campione o un gruppo colori denominato `{name}`
@msg a key object sits on that point su quel punto si trova un oggetto chiave
@msg a page is missing manca una pagina
@msg a page out of range una pagina fuori intervallo
Can't render this file because it is too large.
+3
View File
@@ -3724,6 +3724,8 @@ mark-style Japanese 日本式
Unembed 埋め込みを解除
Unembed… 埋め込みを解除…
Ungroup Color Group カラーグループを解除
Color Group Options カラーグループオプション
Color Group Options… カラーグループオプション…
Uniform 縦横比を固定
Unite 合体
Units 単位
@@ -4955,6 +4957,7 @@ swatch Bright Violet ビビッドバイオレット
@msg select a stroke with a variable width 可変幅の線を選択してください
@msg the selected stroke's profile is already listed as {_1} 選択した線のプロファイルは、すでに {_1} として登録されています
@msg a graphic style named `{to}` already exists `{to}` という名前のグラフィックスタイルはすでに存在します
@msg a swatch or color group named `{name}` already exists `{name}` という名前のスウォッチまたはカラーグループはすでに存在します
@msg a key object sits on that point そのポイントにはキーオブジェクトがあります
@msg no graphic style `{name}` グラフィックスタイル `{name}` が見つかりません
@msg node {_1} is not text ノード {_1} はテキストではありません
Can't render this file because it is too large.
+3
View File
@@ -6014,6 +6014,8 @@ theme Appearance იერსახე
Spot Colors სპოტ-ფერები
Swatch Options ფერის ნიმუშის პარამეტრები
Ungroup Color Group ფერების ჯგუფის დაშლა
Color Group Options ფერების ჯგუფის პარამეტრები
Color Group Options… ფერების ჯგუფის პარამეტრები…
Copy to User Defined მომხმარებლის განსაზღვრულში კოპირება
Swatch Library ფერის ნიმუშების ბიბლიოთეკა
Clear All Tabs ყველა ტაბულაციის გასუფთავება
@@ -6713,6 +6715,7 @@ font-technology Variable ცვლადი
@msg a freeform gradient keeps at least one point თავისუფალი ფორმის გრადიენტი ინარჩუნებს მინიმუმ ერთ წერტილს
@msg a gradient needs at least two stops გრადიენტს სჭირდება მინიმუმ ორი გადასვლის წერტილი
@msg a graphic style named `{to}` already exists გრაფიკული სტილი სახელით `{to}` უკვე არსებობს
@msg a swatch or color group named `{name}` already exists ფერის ნიმუში ან ფერების ჯგუფი სახელით `{name}` უკვე არსებობს
@msg a page is missing გვერდი აკლია
@msg a page out of range გვერდი დიაპაზონს გარეთაა
@msg a page tree kid isn't a reference გვერდების ხის შვილობილი მიმართვა არ არის
Can't render this file because it is too large.
+3
View File
@@ -3713,6 +3713,8 @@ mark-style Japanese 일본식
Unembed 포함 해제
Unembed… 포함 해제…
Ungroup Color Group 색상 그룹 해제
Color Group Options 색상 그룹 옵션
Color Group Options… 색상 그룹 옵션…
Uniform 균일
Unite 합치기
Units 단위
@@ -4882,6 +4884,7 @@ theme Appearance 외관
@msg select a stroke with a variable width 가변 너비 선을 선택하세요
@msg the selected stroke's profile is already listed as {_1} 선택한 선의 프로파일이 이미 {_1}(으)로 등록되어 있습니다
@msg a graphic style named `{to}` already exists `{to}` 그래픽 스타일이 이미 있습니다
@msg a swatch or color group named `{name}` already exists `{name}` 견본 또는 색상 그룹이 이미 있습니다
@msg a key object sits on that point 그 포인트에 키 개체가 있습니다
@msg no graphic style `{name}` `{name}` 그래픽 스타일이 없습니다
@msg node {_1} is not text 노드 {_1}은(는) 텍스트가 아닙니다
Can't render this file because it is too large.
+3
View File
@@ -4551,6 +4551,8 @@ theme Appearance Vormgeving
Spot Colors (0) Spotkleuren (0)
Swatch Options Kleurstaalopties
Ungroup Color Group Kleurgroep opheffen
Color Group Options Opties voor kleurgroep
Color Group Options… Opties voor kleurgroep…
Copy to User Defined Kopiëren naar Gebruikergedefinieerd
Swatch Library Bibliotheek met kleurstalen
Clear All Tabs Alle tabs wissen
@@ -5275,6 +5277,7 @@ imageTrace Outline Contour
@msg a freeform gradient keeps at least one point een verloop met vrije vorm behoudt minstens één punt
@msg a gradient needs at least two stops een verloop heeft minstens twee stops nodig
@msg a graphic style named `{to}` already exists er bestaat al een grafische stijl met de naam `{to}`
@msg a swatch or color group named `{name}` already exists er bestaat al een kleurstaal of kleurgroep met de naam `{name}`
@msg a page is missing er ontbreekt een pagina
@msg a page out of range een pagina buiten het bereik
@msg a page tree kid isn't a reference een kind van de paginaboom is geen verwijzing
Can't render this file because it is too large.
+3
View File
@@ -4128,6 +4128,8 @@ theme Appearance Wygląd
Spot Colors Kolory dodatkowe
Swatch Options Opcje próbki
Ungroup Color Group Rozgrupuj grupę kolorów
Color Group Options Opcje grupy kolorów
Color Group Options… Opcje grupy kolorów…
Copy to User Defined Kopiuj do zdefiniowanych przez użytkownika
Swatch Library Biblioteka próbek
Clear All Tabs Usuń wszystkie tabulatory
@@ -5007,6 +5009,7 @@ liquify-list-end {0}, {1} {0} i {1}
@msg a freeform gradient keeps at least one point gradient dowolny musi mieć co najmniej jeden punkt
@msg a gradient needs at least two stops gradient potrzebuje co najmniej dwóch punktów koloru
@msg a graphic style named `{to}` already exists styl graficzny o nazwie `{to}` już istnieje
@msg a swatch or color group named `{name}` already exists próbka lub grupa kolorów o nazwie `{name}` już istnieje
@msg a key object sits on that point w tym punkcie leży obiekt kluczowy
@msg a page is missing brak strony
@msg a page out of range strona spoza zakresu
Can't render this file because it is too large.
+3
View File
@@ -3361,6 +3361,8 @@ digits Malayalam Malaiala
Unembed… Desincorporar…
Ungroup Desagrupar
Ungroup Color Group Desagrupar Grupo de Cores
Color Group Options Opções de Grupo de Cores
Color Group Options… Opções de Grupo de Cores…
Uniform Uniforme
Unite Unir
Units Unidades
@@ -4202,6 +4204,7 @@ axis Both Ambos
@msg a freeform gradient keeps at least one point um gradiente de forma livre mantém pelo menos um ponto
@msg a gradient needs at least two stops um gradiente precisa de pelo menos duas paradas
@msg a graphic style named `{to}` already exists já existe um estilo gráfico chamado `{to}`
@msg a swatch or color group named `{name}` already exists já existe uma amostra ou um grupo de cores chamado `{name}`
@msg a key object sits on that point há um objeto-chave nesse ponto
@msg a page is missing falta uma página
@msg a page out of range uma página fora do intervalo
Can't render this file because it is too large.
+3
View File
@@ -4146,6 +4146,8 @@ digits Malayalam Малаялам
Unembed… Извлечь…
Ungroup Разгруппировать
Ungroup Color Group Разгруппировать цветовую группу
Color Group Options Параметры цветовой группы
Color Group Options… Параметры цветовой группы…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4913,6 +4915,7 @@ liquify-list-end {0}, {1} {0} и {1}
@msg a freeform gradient keeps at least one point произвольный градиент сохраняет как минимум одну точку
@msg a gradient needs at least two stops градиенту нужны как минимум две точки перехода
@msg a graphic style named `{to}` already exists графический стиль с именем `{to}` уже существует
@msg a swatch or color group named `{name}` already exists образец или цветовая группа с именем `{name}` уже существует
@msg a key object sits on that point в этой точке находится ключевой объект
@msg a page is missing страница отсутствует
@msg a page out of range страница вне диапазона
Can't render this file because it is too large.
+4
View File
@@ -4031,6 +4031,8 @@ digits Malayalam Malayalam
Unembed… Ta bort inbäddning…
Ungroup Dela upp grupp
Ungroup Color Group Dela upp färggrupp
Color Group Options Färggruppsalternativ
Color Group Options… Färggruppsalternativ…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4793,6 +4795,8 @@ liquify-list-end {0}, {1} {0} och {1}
@msg a freeform gradient keeps at least one point en fri gradient behåller minst en punkt
@msg a gradient needs at least two stops en gradient behöver minst två stopp
@msg a graphic style named `{to}` already exists det finns redan en grafisk stil med namnet `{to}`
@msg a swatch or color group named `{name}` already exists det finns redan en färgruta eller färggrupp med namnet `{name}`
@msg no colour group `{group}` ingen färggrupp `{group}`
@msg a key object sits on that point ett nyckelobjekt ligger på den punkten
@msg a page is missing en sida saknas
@msg a page out of range en sida utanför intervallet
Can't render this file because it is too large.
+3
View File
@@ -3885,6 +3885,8 @@ digits Malayalam Malayalam
Unembed… Gömmeyi kaldır…
Ungroup Grubu Çöz
Ungroup Color Group Renk Grubunun Grubunu Çöz
Color Group Options Renk Grubu Seçenekleri
Color Group Options… Renk Grubu Seçenekleri…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4602,6 +4604,7 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg a freeform gradient keeps at least one point serbest biçimli bir degrade en az bir noktayı korur
@msg a gradient needs at least two stops bir degradenin en az iki durağa ihtiyacı vardır
@msg a graphic style named `{to}` already exists `{to}` adlı bir grafik stili zaten mevcut
@msg a swatch or color group named `{name}` already exists `{name}` adlı bir renk örneği veya renk grubu zaten mevcut
@msg a page is missing bir sayfa eksik
@msg a page out of range aralık dışında bir sayfa
@msg a page tree kid isn't a reference sayfa ağacı çocuğu bir referans değildir
Can't render this file because it is too large.
+3
View File
@@ -4156,6 +4156,8 @@ effect Points Точки
Unembed… Витягти…
Ungroup Розгрупувати
Ungroup Color Group Розгрупувати колірну групу
Color Group Options Параметри колірної групи
Color Group Options… Параметри колірної групи…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4903,6 +4905,7 @@ liquify-list-end {0}, {1} {0} і {1}
@msg a freeform gradient keeps at least one point довільний градієнт зберігає як мінімум одну точку
@msg a gradient needs at least two stops градієнту потрібні як мінімум дві точки переходу
@msg a graphic style named `{to}` already exists графічний стиль з ім’ям `{to}` вже існує
@msg a swatch or color group named `{name}` already exists зразок або колірна група з ім’ям `{name}` вже існує
@msg a key object sits on that point у цій точці розташований ключовий об’єкт
@msg a page is missing сторінка відсутня
@msg a page out of range сторінка поза діапазоном
Can't render this file because it is too large.
+5
View File
@@ -4554,6 +4554,8 @@ mark-style Japanese Kiểu Nhật
Unembed… Bỏ nhúng…
Ungroup Bỏ nhóm
Ungroup Color Group Bỏ nhóm màu
Color Group Options Tùy chọn nhóm màu
Color Group Options… Tùy chọn nhóm màu…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4892,6 +4894,9 @@ theme Appearance Giao diện
@msg a freeform gradient keeps at least one point chuyển sắc tự do cần giữ ít nhất một điểm
@msg a gradient needs at least two stops chuyển sắc cần ít nhất hai điểm dừng
@msg a graphic style named `{to}` already exists đã có kiểu đồ họa tên `{to}`
@msg a swatch or color group named `{name}` already exists đã có mẫu màu hoặc nhóm màu tên `{name}`
@msg missing `group` thiếu `group`
@msg no colour group `{group}` không có nhóm màu `{group}`
@msg a key object sits on that point có đối tượng khóa nằm trên điểm đó
@msg a layer couldn't be read một lớp không thể đọc được
@msg a page is missing thiếu một trang
Can't render this file because it contains an unexpected character in line 205 and column 5.
+3
View File
@@ -3977,6 +3977,8 @@ digits Malayalam 马拉雅拉姆数字
Unembed… 取消嵌入…
Ungroup 取消编组
Ungroup Color Group 取消编组颜色组
Color Group Options 颜色组选项
Color Group Options… 颜色组选项…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
@@ -4648,6 +4650,7 @@ imageTrace Outline 轮廓
@msg select a stroke with a variable width 请选择一个宽度可变的描边
@msg the selected stroke's profile is already listed as {_1} 所选描边的配置文件已列为 {_1}
@msg a graphic style named `{to}` already exists 名为 `{to}` 的图形样式已存在
@msg a swatch or color group named `{name}` already exists 名为 `{name}` 的色板或颜色组已存在
@msg no graphic style `{name}` 没有图形样式 `{name}`
@msg node {_1} is not text 节点 {_1} 不是文字
@msg node {_1} is on a locked artboard 节点 {_1} 位于已锁定的画板上
Can't render this file because it is too large.
+3
View File
@@ -2181,6 +2181,7 @@ file-filter Templates 範本
@msg select a stroke with a variable width 請選取寬度可變的筆畫
@msg the selected stroke's profile is already listed as {_1} 所選筆畫的描述檔已列為 {_1}
@msg a graphic style named `{to}` already exists 名為 `{to}` 的繪圖樣式已存在
@msg a swatch or color group named `{name}` already exists 名為 `{name}` 的色票或顏色群組已存在
@msg no graphic style `{name}` 沒有繪圖樣式 `{name}`
@msg node {_1} is not text 節點 {_1} 不是文字
@msg node {_1} is on a locked artboard 節點 {_1} 位於已鎖定的工作區域上
@@ -5300,6 +5301,8 @@ digits Malayalam 馬來亞拉姆數字
Unembed… 取消嵌入…
Ungroup 解散群組
Ungroup Color Group 解散顏色群組
Color Group Options 顏色群組選項
Color Group Options… 顏色群組選項…
Unicode Unicode
Unicode (UTF-16) Unicode (UTF-16)
Unicode (UTF-8) Unicode (UTF-8)
Can't render this file because it is too large.
+1
View File
@@ -760,6 +760,7 @@ fn run_ui_part7(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
let names = p.get("swatches").and_then(Value::as_array).map(|a| a.iter().filter_map(Value::as_str).map(str::to_string).collect());
crate::dialogs::new_color_group::open(app, names.unwrap_or_default())
}
"ui.colorGroupOptions" => crate::dialogs::color_group_options::open(app, p),
"ui.colorPicker" => crate::dialogs::open_color_picker(app, p),
"ui.sampleScreenColor" => crate::screen_color::start(app, p),
"ui.graphicStyleOptions" => crate::dialogs::graphic_style_options::open(app, s("name").as_deref()),
+1 -1
View File
@@ -269,7 +269,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool {
}
"ui.missingFontsDialog" => !cfg!(target_arch = "wasm32") && app.session.active().is_some(),
"ui.findFontsInFolder" => crate::picks::can(app, &crate::picks::PickRequest::Folder) && app.session.active().is_some(),
"ui.swatchOptions" | "ui.newSwatch" | "ui.newColorGroup" => app.session.active().is_some(),
"ui.swatchOptions" | "ui.newSwatch" | "ui.newColorGroup" | "ui.colorGroupOptions" => app.session.active().is_some(),
"ui.graphicStyleOptions" | "ui.charStyleOptions" | "ui.paraStyleOptions" | "ui.newCharStyle" | "ui.newParaStyle" => {
app.session.active().is_some()
}
+6
View File
@@ -904,6 +904,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"",
"{swatches?: [names]} open New Color Group, from those swatches or the selected artwork (dialog `newColorGroup`, engine: swatch.newGroup)",
),
(
"ui.colorGroupOptions",
"Color Group Options…",
"",
"{group} open Color Group Options for that color group (dialog `colorGroupOptions`, field `name`): OK renames the group (engine: swatch.renameGroup); a name that is empty or that another color group or a swatch has keeps the dialog open",
),
(
"ui.colorPicker",
"Color Picker…",
+15 -4
View File
@@ -325,8 +325,8 @@ pub(crate) fn after_command(app: &mut VectorcraftApp, id: &str, params: &Value,
/// replied `reply` in its document, or `None` when the command may have removed it or made it a
/// process color: Swatch Options making it a process color, Delete Swatch naming it or its group,
/// Merge Swatches merging it into another and Edit Color Group leaving it out of its group.
/// `group` follows the step: New Color Group, Move Swatch, Edit Color Group and Ungroup Color
/// Group.
/// `group` follows the step: New Color Group, Move Swatch, Edit Color Group, Ungroup Color Group
/// and Color Group Options.
fn follow_step(id: &str, p: &Value, reply: &Value, name: String, group: &mut Option<String>) -> Option<String> {
let ours = |v: &Value| v == name.as_str();
let in_group = |key: &str| group.as_deref().is_some_and(|g| p[key] == g);
@@ -346,6 +346,7 @@ fn follow_step(id: &str, p: &Value, reply: &Value, name: String, group: &mut Opt
let moved = match id {
"swatch.newGroup" | "swatch.editGroup" if members("swatches") => Some(reply["name"].as_str().map(str::to_string)),
"swatch.ungroup" if in_group("name") => Some(None),
"swatch.renameGroup" if in_group("group") => Some(reply["name"].as_str().map(str::to_string)),
"swatch.move" if ours(&p["name"]) || p["names"].as_array().is_some_and(|a| a.iter().any(ours)) => {
Some(p["group"].as_str().map(str::to_string))
}
@@ -1566,8 +1567,8 @@ mod tests {
assert!(linked(&app, &ctx));
}
/// Deleting the color group that holds the spot color base's swatch ends the link; an Edit
/// Color Group that keeps it does not.
/// Deleting the color group that holds the spot color base's swatch ends the link, also under
/// a name Color Group Options gave it; an Edit Color Group that keeps it does not.
#[test]
fn a_deleted_color_group_ends_the_link() {
let mut app = spot_app(1.0);
@@ -1599,6 +1600,16 @@ mod tests {
]);
app.run("command.batch", json!({"commands": steps})).unwrap();
assert!(!linked(&app, &ctx), "moved into a group that was deleted");
// Its group renamed by Color Group Options and deleted under the new name in the same batch.
relink(&mut app);
let steps = json!([
{"command": "swatch.newGroup", "params": {"name": "Spots", "swatches": ["Ink"]}},
{"command": "swatch.renameGroup", "params": {"group": "Spots", "name": "Spot Inks"}},
{"command": "swatch.delete", "params": {"names": ["Spot Inks"]}},
{"command": "swatch.new", "params": {"name": "Ink", "color": "#669933", "spot": true}},
]);
app.run("command.batch", json!({"commands": steps})).unwrap();
assert!(!linked(&app, &ctx), "its group renamed, then deleted");
// Edit Color Group that keeps it, with a new group name, keeps the link.
relink(&mut app);
app.run("swatch.newGroup", json!({"name": "Spots", "swatches": ["Ink"]})).unwrap();
+27
View File
@@ -212,6 +212,33 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
body(app, ui, TILE);
}
/// Command `id` ran with `params` and replied `reply`: a color group that `swatch.renameGroup`
/// renamed stays selected in the panel under its new name, and Shift-click still extends the
/// selection from it. The steps of a `command.batch` are followed in order.
pub(crate) fn after_command(ctx: &egui::Context, id: &str, params: &Value, reply: &Value) {
match id {
"swatch.renameGroup" => {
let (Some(old), Some(new)) = (params["group"].as_str(), reply["name"].as_str()) else { return };
let mut sel: Vec<String> = pstate(ctx, "swatch-selected");
for n in sel.iter_mut().filter(|n| *n == old) {
*n = new.to_string();
}
set_pstate(ctx, "swatch-selected", sel);
if pstate::<String>(ctx, "swatch-anchor") == old {
set_pstate(ctx, "swatch-anchor", new.to_string());
}
}
"command.batch" => {
let steps = params["commands"].as_array().map(Vec::as_slice).unwrap_or_default();
let results = reply["results"].as_array().map(Vec::as_slice).unwrap_or_default();
for (step, r) in steps.iter().zip(results) {
after_command(ctx, step["command"].as_str().unwrap_or_default(), &step["params"], r);
}
}
_ => {}
}
}
/// Item actions target the clicked swatch, independently of the paint or other selected chips.
fn item_context_menu(app: &mut VectorcraftApp, ui: &Ui, resp: &Response, e: &Entry) {
if e.is_folder() {
@@ -31,6 +31,14 @@ pub(super) fn selected_group(app: &VectorcraftApp, sel: &[String]) -> Option<Str
sel.iter().find(|n| d.swatch_groups.iter().any(|g| g.name == **n)).cloned()
}
/// The selected color group when it is the whole selection (Color Group Options).
fn sole_group(app: &VectorcraftApp, sel: &[String]) -> Option<String> {
match sel {
[_] => selected_group(app, sel),
_ => None,
}
}
/// Edit or Apply Color Group: Recolor Artwork on colour group `group` (and the selected art).
pub(super) fn edit_group(app: &mut VectorcraftApp, group: &str) {
app.run("ui.recolorDialog", json!({ "group": group })).ok();
@@ -196,6 +204,12 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
{
app.run("swatch.ungroup", json!({ "name": g })).ok();
}
let sole = sole_group(app, &selected);
if menu_item(ui, tl!("Color Group Options…"), sole.is_some(), false)
&& let Some(g) = sole
{
app.run("ui.colorGroupOptions", json!({ "group": g })).ok();
}
if menu_item(ui, tl!("Select All Unused"), true, false)
&& let Ok(r) = app.run("swatch.unused", json!({}))
{
@@ -1230,6 +1230,44 @@ fn click_menu_item(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str) {
menu_frame(app, ctx, vec![button(false)]);
}
/// The panel menu's Color Group Options… opens on the selected color group when that group is the
/// whole selection; with nothing selected, a swatch alone, or a swatch or a second group beside the
/// group, it opens nothing. After OK, and after `swatch.renameGroup` run on its own or in a batch,
/// the group stays selected under its new name.
#[test]
fn color_group_options_opens_on_a_sole_selected_group() {
let mut app = app();
let ctx = context();
for sel in [vec![], vec!["Red"], vec!["Brights", "Red"], vec!["Brights", "Grays"]] {
set_pstate(&ctx, "swatch-selected", sel.iter().map(|s| s.to_string()).collect::<Vec<_>>());
click_menu_item(&mut app, &ctx, "Color Group Options…");
assert!(app.ui.dialog.is_none(), "{sel:?}");
}
set_pstate(&ctx, "swatch-selected", vec!["Grays".to_string()]);
click_menu_item(&mut app, &ctx, "Color Group Options…");
let d = app.ui.dialog.as_ref().expect("Color Group Options opens");
assert_eq!((d.kind.as_str(), d.str("__group").as_str()), (crate::dialogs::color_group_options::KIND, "Grays"));
// OK keeps the renamed group selected, so the item opens on it again.
app.ui_ctx = Some(ctx.clone());
set_pstate(&ctx, "swatch-anchor", "Grays".to_string());
app.ui.dialog.as_mut().unwrap().fields.insert("name".into(), json!("Neutrals"));
crate::dialogs::confirm(&mut app).unwrap();
assert_eq!(selected(&ctx), ["Neutrals"]);
assert_eq!(pstate::<String>(&ctx, "swatch-anchor"), "Neutrals", "Shift-click extends from the renamed group");
click_menu_item(&mut app, &ctx, "Color Group Options…");
assert_eq!(app.ui.dialog.as_ref().map(|d| d.str("__group")).as_deref(), Some("Neutrals"));
crate::dialogs::cancel(&mut app);
// The command run on its own, and as batch steps, keeps the selection the same way.
app.run("swatch.renameGroup", json!({"group": "Neutrals", "name": "Stone"})).unwrap();
assert_eq!((selected(&ctx), pstate::<String>(&ctx, "swatch-anchor")), (vec!["Stone".to_string()], "Stone".to_string()));
let steps = json!([
{"command": "swatch.renameGroup", "params": {"group": "Stone", "name": "Slate"}},
{"command": "swatch.renameGroup", "params": {"group": "Slate", "name": "Ash"}},
]);
app.run("command.batch", json!({"commands": steps})).unwrap();
assert_eq!((selected(&ctx), pstate::<String>(&ctx, "swatch-anchor")), (vec!["Ash".to_string()], "Ash".to_string()));
}
/// The panel menu's Show Recent Colors hides and shows the panel's Recent Colors row (#6617):
/// checked by default, applied colors still join the list while the row is hidden, and the Color
/// panel keeps its own row and setting.
+3 -1
View File
@@ -147,7 +147,9 @@ those rows with `layer.delete` in the document the question was asked in. `layer
New swatches and colour groups: `ui.newSwatch {spot?, global?, group?}` opens the `newSwatch` dialog prefilled from the active
fill or stroke (fields as in `swatchOptions` plus `group`; a gradient or pattern only takes `name`) and
`ui.newColorGroup {swatches?}` opens `newColorGroup` (fields `name`, `fromArtwork`, `toGlobal`, `includeTints`,
`swatches`); `ui.dialog.confirm` runs `swatch.new` / `swatch.newGroup`.
`swatches`); `ui.dialog.confirm` runs `swatch.new` / `swatch.newGroup`. `ui.colorGroupOptions {group}` opens
`colorGroupOptions` (fields `name` and `__group`), whose `ui.dialog.confirm` runs `swatch.renameGroup`; a refused name
keeps the dialog open.
The Color Picker is a dialog too: `engine.execute {command: "ui.colorPicker", params: {stroke?, color?}}` opens it for the fill (or stroke) proxy; `ui.dialog.set {field: "hex", value: "00FF00"}` (or `color`, `channel`, `webOnly`, `swatches`) then `ui.dialog.confirm` applies the colour through `paint.setFill` / `paint.setStroke`.
+3 -1
View File
@@ -1064,7 +1064,9 @@ in the app runs `paint.setFill` (or `paint.setStroke`, the active proxy) with `i
The Swatches panel menu's commands: `swatch.addUsedColors {selection?, global?}`, `swatch.unused` (a query: the
names Select All Unused selects; a spot swatch counts as used while an image placed from a DCS file has a plate of
its ink), `swatch.merge {names}` (the first is kept; gradient stops linked to the others drop their process
plates), `swatch.ungroup {name}` and
plates), `swatch.ungroup {name}`, `swatch.renameGroup {group, name}` (Color Group Options: renames the group alone
in one undo step; the name is trimmed, and a name that is empty or that another color group or a swatch has is an
error; the group's own name records no undo step) and
`swatch.sortByKind`.
`brush.move {name | names, to?, type?}` reorders brushes among the brushes of their type, as dragging one onto
another of its type in the Brushes panel does. `to` is an index among the brushes of that type in `brush.list`
+1
View File
@@ -1738,6 +1738,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
Editing, renaming, deleting or merging a global swatch also changes the colors linked to it in graph designs, the art of brushes and the tile that pattern editing's Cancel puts back, in the same undo step as the rest of the art; Default Swatches with replace unlinks them there too.
A swatch step in `command.batch` (Delete, Swatch Options, Merge, Edit Color Group) changes the fill and stroke for new art as the command run on its own does, so art drawn later in the batch or after it takes the same paint; a batch that fails, and a canceled batch preview, put back the paints it started with, and a canceled Swatch Options preview leaves them as they were. These swatch commands also change the fills and strokes of the appearance new art takes, and Undo and Redo of the command or the batch put the paints for new art back with the swatches. Spot Colors options (`swatch.spotOptions`) and Default Swatches with replace (`swatch.resetDefaults {replace: true}`) as `command.batch` steps also change the fill and stroke for new art as each command run on its own does: a fill or stroke linked to a Lab spot swatch keeps its link and tint and takes the Lab values or their CMYK equivalent, and one linked to a swatch the replace removes keeps its color and loses the link. Evidence: `swatch_steps_in_a_batch_change_the_new_art_paints_as_commands_do`, `spot_colors_options_in_a_batch_change_the_new_art_paints_as_the_command_does`, `default_swatches_replace_in_a_batch_unlinks_the_new_art_paints_as_the_command_does`, `undo_and_redo_of_a_swatch_edit_put_back_the_new_art_paints`, `swatch_edits_reach_the_paints_of_the_new_art_template`, `a_failed_batch_puts_back_the_new_art_paints_a_swatch_step_changed` and `canceling_a_swatch_options_preview_keeps_the_new_art_paints` in `crates/engine/src/tests/swatches.rs`.
Add Used Colors (`swatch.addUsedColors`) and Select All Unused (`swatch.unused`) look colors, swatch names, links, tints and gradients up in hash sets instead of searching every swatch and color for each color or linked paint (New Color Group from artwork too), and New Swatch with several colors (`swatch.new`), New Color Group (`swatch.newGroup`) and Edit Color Group (`swatch.editGroup`) name their new swatches from one set of the names already taken. The new swatches keep their names, order and links, and Select All Unused lists the same swatches. Evidence: `add_used_colors_adds_each_new_color_once_with_free_names`, `add_used_colors_global_links_every_paint_of_a_new_color`, `unused_matches_links_tints_colors_gradients_and_patterns_exactly`, `new_swatches_from_colors_are_numbered_after_names_already_taken`, `new_color_group_numbers_its_colors_after_the_group_and_its_moved_swatches`, `new_color_group_from_artwork_lists_each_color_once_with_free_names` and `edit_color_group_numbers_extra_colors_after_the_names_it_keeps` in `crates/engine/src/tests/swatchcmds.rs`; `free_swatch_names_match_naming_each_swatch_as_it_is_added` and `free_swatch_names_match_new_swatch_names_as_swatches_are_added` in `crates/doc/src/swatches.rs`.
Color Group Options… in the Swatches panel menu names the selected color group: its dialog shows the group's name in a Name field, and OK renames the group (`swatch.renameGroup`, `ui.colorGroupOptions`) while its swatches, their colors and the art linked to them stay as they are ([help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/learn-color-basics/create-color-groups-in-the-color-guide-panel.html)). VectorCraft's own rules: the item is available only when that one group is the whole panel selection; the name is trimmed; a name that is empty or that another color group or a swatch has (swatches and groups share one set of names) is an error and keeps the dialog open; a rename is one undo step, and the group's own name records none. Double-clicking a group's folder and the options button still open Edit or Apply Color Group. Evidence: `rename_group_renames_only_the_group_in_one_undo_step` in `crates/engine/src/tests/swatchcmds.rs`, `renames_the_group_and_keeps_a_refused_name_open` in `crates/ui-egui/src/dialogs/color_group_options.rs` and `color_group_options_opens_on_a_sole_selected_group` in `crates/ui-egui/src/panels/swatches/tests.rs`.
- **Colorized images (#1466):** a fill color applied to a selected grayscale or 1-bit image (`paint.setFill`) colorizes it with black, white, a process color or a spot color, and refuses a process color when the image has an alpha channel ([Convert color modes](https://web.archive.org/web/20251220223850/https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/convert-color-modes.html), "Colorize Grayscale or 1-bit images"); black and white are accepted there too. The canvas draws each pixel in the color as far as the pixel is dark, with white pixels transparent; PDF export writes the image in the color (a spot color as its ink, Registration in every ink) with the image as its soft mask; Separations Preview and printed separations show it on its color's plates; native files keep the color. SVG writes the fill color through a coverage mask (or a colorized PNG in Tiny 1.2); EPS writes binary coverage as an image mask in the color's ink, and a grayscale image as ink samples scaled by coverage, with white pixels left out at Level 3 and gray midtones written over white.
The prompt for deleting several swatches and groups uses the interface language's plural form for the count. Evidence: `deleting_several_swatches_uses_each_count_form` in `crates/ui-egui/src/panels/swatches/tests.rs`.
- **Colorized images (#1466):** a fill color applied to a selected grayscale or 1-bit image (`paint.setFill`) colorizes it with black, white, a process color or a spot color, and refuses a process color when the image has an alpha channel ([Convert color modes](https://web.archive.org/web/20251220223850/https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/convert-color-modes.html), "Colorize Grayscale or 1-bit images"); black and white are accepted there too. The canvas draws each pixel in the color as far as the pixel is dark, with white pixels transparent; PDF export writes the image in the color (a spot color as its ink, Registration in every ink) with the image as its soft mask; Separations Preview and printed separations show it on its color's plates; native files keep the color. EPS and SVG write the image's own pixels.