Color Themes: Set Active Color paints the current fill or stroke with the selected color

A button on the Create tab, beside the pipette that copies the current
color into the theme, does the reverse: it sends the selected theme color
to the proxy in front, through paint.setFill or paint.setStroke with
keepModel, so the selection and the default for new art take it in its
own color model. A click is one undo step; a click that changes no art
adds none. The button is off without a document.

The help page describes this action for creating a color theme:
https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=222
This commit is contained in:
dotCooCoo
2026-11-17 15:12:20 -08:00
parent ee60c51fd9
commit 1f41683f58
31 changed files with 176 additions and 2 deletions
+1
View File
@@ -3368,6 +3368,7 @@ digits Malayalam Малаялам
Set Slice Rectangle Задаване на правоъгълник за резен
Set Tab Stops Задаване на табулатори
Set Text Задаване на текст
Set the current fill or stroke to the selected color Задаване на избрания цвят като текущо запълване или щрих
Set the selected color to the current color Задаване на текущия цвят като избран
Set Zoom Задаване на мащаб
Settings… Настройки…
Can't render this file because it is too large.
+1
View File
@@ -1735,6 +1735,7 @@ digits Malayalam Malajalam
Rule: Pravilo:
Save changes to {name} Sačuvaj promjene u {name}
Save theme to My Themes Sačuvaj temu u Moje teme
Set the current fill or stroke to the selected color Postavi odabranu boju kao trenutnu ispunu ili potez
Set the selected color to the current color Postavi odabranu boju na trenutnu boju
Copy All Styles Kopiraj sve stilove
Exported {path} Izvezeno: {path}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -4384,6 +4384,7 @@ digits Malayalam Malaiàlam
Set Slice Rectangle Defineix el rectangle del tall
Set Tab Stops Defineix les tabulacions
Set Text Defineix el text
Set the current fill or stroke to the selected color Defineix el color seleccionat com a farciment o traç actual
Set the selected color to the current color Defineix el color seleccionat com a color actual
Set Zoom Defineix el zoom
Set: Defineix:
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -1806,6 +1806,7 @@ digits Malayalam Malajálamské
Rule: Pravidlo:
Save changes to {name} Uložit změny do {name}
Save theme to My Themes Uložit motiv do Mých motivů
Set the current fill or stroke to the selected color Nastavit vybranou barvu jako aktuální výplň nebo tah
Set the selected color to the current color Nastavit vybranou barvu jako aktuální barvu
Copy All Styles Kopírovat všechny styly
Exported {path} Exportováno: {path}
Can't render this file because it is too large.
+1
View File
@@ -4403,6 +4403,7 @@ digits Malayalam Malayalam
Rule: Regel:
Save changes to {name} Gem ændringer i {name}
Save theme to My Themes Gem tema i Mine temaer
Set the current fill or stroke to the selected color Sæt den aktuelle udfyldning eller streg til den markerede farve
Set the selected color to the current color Sæt den markerede farve til den aktuelle farve
Copy All Styles Kopiér alle typografier
Exported {path} Eksporterede {path}
Can't render this file because it is too large.
+1
View File
@@ -3434,6 +3434,7 @@ digits Malayalam Malayalam
Set Slice Rectangle Slice-Rechteck festlegen
Set Tab Stops Tabstopps festlegen
Set Text Text festlegen
Set the current fill or stroke to the selected color Aktuelle Fläche oder Kontur auf die ausgewählte Farbe setzen
Set the selected color to the current color Ausgewählte Farbe auf die aktuelle Farbe setzen
Set Zoom Zoom festlegen
Settings… Einstellungen…
Can't render this file because it is too large.
+1
View File
@@ -4127,6 +4127,7 @@ digits Malayalam Μαλαγιάλαμ
Set Slice Rectangle Ορισμός ορθογωνίου τομής
Set Tab Stops Ορισμός στηλοθετών
Set Text Ορισμός κειμένου
Set the current fill or stroke to the selected color Ορισμός επιλεγμένου χρώματος ως τρέχοντος γεμίσματος ή περιγράμματος
Set the selected color to the current color Ορισμός επιλεγμένου χρώματος ως τρέχοντος
Set Zoom Ορισμός ζουμ
Setup… Ρύθμιση…
Can't render this file because it is too large.
+1
View File
@@ -3470,6 +3470,7 @@ digits Malayalam Malayálam
Set Slice Rectangle Definir rectángulo de sector
Set Tab Stops Definir tabulaciones
Set Text Definir texto
Set the current fill or stroke to the selected color Asignar el color seleccionado al relleno o trazo actual
Set the selected color to the current color Asignar el color actual al color seleccionado
Set Zoom Definir zoom
Settings… Ajustes…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -1779,6 +1779,7 @@ digits Malayalam Malajalam
Rule: Sääntö:
Save changes to {name} Tallenna muutokset kohteeseen {name}
Save theme to My Themes Tallenna teema Omiin teemoihin
Set the current fill or stroke to the selected color Aseta nykyiseksi täytöksi tai viivaksi valittu väri
Set the selected color to the current color Aseta valituksi väriksi nykyinen väri
Copy All Styles Kopioi kaikki tyylit
Exported {path} Viety: {path}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -3458,6 +3458,7 @@ digits Malayalam Malayalam
Set Slice Rectangle Définir le rectangle de tranche
Set Tab Stops Définir les taquets de tabulation
Set Text Définir le texte
Set the current fill or stroke to the selected color Appliquer la couleur sélectionnée au fond ou au contour actuel
Set the selected color to the current color Remplacer la couleur sélectionnée par la couleur actuelle
Set Zoom Définir le zoom
Settings… Réglages…
Can't render this file because it is too large.
+1
View File
@@ -3614,6 +3614,7 @@
Set Zoom ઝૂમ સેટ કરો
Set as Default ડિફૉલ્ટ તરીકે સેટ કરો
Set base color to the current color બેઝ રંગ વર્તમાન રંગ પર સેટ કરો
Set the current fill or stroke to the selected color વર્તમાન ભરો અથવા સ્ટ્રોક પસંદ કરેલ રંગ પર સેટ કરો
Set the selected color to the current color પસંદ કરેલ રંગ વર્તમાન રંગ પર સેટ કરો
Set {n} {n} સેટ કરો
Settings સેટિંગ્સ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+1
View File
@@ -4699,6 +4699,7 @@ antiAlias Sharp शार्प
Set Slice Rectangle सेट स्लाइस आयत
Set Tab Stops टैब स्टॉप्स सेट करें
Set Text टेक्स्ट सेट करें
Set the current fill or stroke to the selected color वर्तमान फ़िल या स्ट्रोक को सिलेक्टेड रंग में सेट करें
Set the selected color to the current color सिलेक्टेड रंग को वर्तमान रंग में सेट करें
Set Zoom ज़ूम सेट करें
Set: सेट:
Can't render this file because it is too large.
+1
View File
@@ -4104,6 +4104,7 @@ mark-style Japanese Japán
Set Slice Rectangle Szelet téglalapjának beállítása
Set Tab Stops Tabulátorpontok beállítása
Set Text Szöveg beállítása
Set the current fill or stroke to the selected color Az aktuális kitöltés vagy körvonal legyen a kijelölt szín
Set the selected color to the current color A kijelölt szín legyen az aktuális szín
Set Zoom Nagyítás beállítása
Set: Készlet:
Can't render this file because it is too large.
+1
View File
@@ -1662,6 +1662,7 @@ digits Malayalam Malayalam
Rule: Aturan:
Save changes to {name} Simpan perubahan ke {name}
Save theme to My Themes Simpan tema ke Tema saya
Set the current fill or stroke to the selected color Atur isian atau stroke saat ini ke warna terpilih
Set the selected color to the current color Atur warna terpilih ke warna saat ini
Copy All Styles Salin semua gaya
Exported {path} Diekspor ke {path}
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
1662
1663
1664
1665
1666
1667
1668
+1
View File
@@ -3515,6 +3515,7 @@ digits Malayalam Malayalam
Set Slice Rectangle Imposta rettangolo sezione
Set Tab Stops Imposta tabulazioni
Set Text Imposta testo
Set the current fill or stroke to the selected color Imposta il riempimento o la traccia corrente sul colore selezionato
Set the selected color to the current color Imposta il colore selezionato sul colore corrente
Set Zoom Imposta zoom
Settings… Impostazioni…
Can't render this file because it is too large.
+1
View File
@@ -3370,6 +3370,7 @@ mark-style Japanese 日本式
Set Text テキストを設定
Set Zoom ズーム率を設定
Set base color to the current color 基本カラーを現在のカラーに設定
Set the current fill or stroke to the selected color 現在の塗りまたは線を選択したカラーに設定
Set the selected color to the current color 選択したカラーを現在のカラーに設定
Setup… 設定…
Shape Builder シェイプ形成ツール
Can't render this file because it is too large.
+1
View File
@@ -3840,6 +3840,7 @@ digits Malayalam მალაიალამური
Rule: წესი:
Save changes to {name} ცვლილებების შენახვა: {name}
Save theme to My Themes თემის შენახვა „ჩემ თემებში“
Set the current fill or stroke to the selected color მიმდინარე შევსების ან კონტურის მონიშნულ ფერად დაყენება
Set the selected color to the current color მონიშნული ფერის მიმდინარე ფერად დაყენება
Copy All Styles ყველა სტილის კოპირება
Exported {path} ექსპორტირებულია: {path}
Can't render this file because it is too large.
+1
View File
@@ -3359,6 +3359,7 @@ mark-style Japanese 일본식
Set Text 문자 설정
Set Zoom 확대/축소 설정
Set base color to the current color 기준 색상을 현재 색상으로 설정
Set the current fill or stroke to the selected color 현재 칠 또는 선을 선택한 색상으로 설정
Set the selected color to the current color 선택한 색상을 현재 색상으로 설정
Setup… 설정…
Shape Builder 모양 빌더
Can't render this file because it is too large.
+1
View File
@@ -2277,6 +2277,7 @@ digits Malayalam Malayalam
Rule: Regel:
Save changes to {name} Wijzigingen opslaan in {name}
Save theme to My Themes Thema opslaan in Mijn thema's
Set the current fill or stroke to the selected color De huidige vulling of contour op de geselecteerde kleur instellen
Set the selected color to the current color De geselecteerde kleur op de huidige kleur instellen
Copy All Styles Alle stijlen kopiëren
Exported {path} {path} geëxporteerd
Can't render this file because it is too large.
+1
View File
@@ -1718,6 +1718,7 @@ digits Malayalam Malajalam
Rule: Reguła:
Save changes to {name} Zapisz zmiany w {name}
Save theme to My Themes Zapisz motyw w Moich motywach
Set the current fill or stroke to the selected color Ustaw bieżące wypełnienie lub obrys na zaznaczony kolor
Set the selected color to the current color Ustaw zaznaczony kolor na bieżący
Copy All Styles Kopiuj wszystkie style
Exported {path} Wyeksportowano {path}
Can't render this file because it is too large.
+1
View File
@@ -2920,6 +2920,7 @@ digits Malayalam Malaiala
Set Text Definir Texto
Set Zoom Definir Zoom
Set base color to the current color Definir cor base para a cor atual
Set the current fill or stroke to the selected color Definir o preenchimento ou traçado atual para a cor selecionada
Set the selected color to the current color Definir a cor selecionada para a cor atual
Setup… Configuração…
Shadows and Glows Sombras e Brilhos
Can't render this file because it is too large.
+1
View File
@@ -3502,6 +3502,7 @@ digits Malayalam Малаялам
Set Slice Rectangle Задать прямоугольник фрагмента
Set Tab Stops Задать табуляции
Set Text Задать текст
Set the current fill or stroke to the selected color Назначить выбранный цвет текущей заливке или обводке
Set the selected color to the current color Назначить текущий цвет выбранному цвету
Set Zoom Задать масштаб
Settings… Параметры…
Can't render this file because it is too large.
+1
View File
@@ -3388,6 +3388,7 @@ digits Malayalam Malayalam
Set Slice Rectangle Ange skivrektangel
Set Tab Stops Ange tabbstopp
Set Text Ange text
Set the current fill or stroke to the selected color Ersätt den aktuella fyllningen eller konturen med den markerade färgen
Set the selected color to the current color Ersätt den markerade färgen med den aktuella färgen
Set Zoom Ange zoom
Settings… Inställningar…
Can't render this file because it is too large.
+1
View File
@@ -3260,6 +3260,7 @@ digits Malayalam Malayalam
Set Slice Rectangle Dilim Dikdörtgenini Ayarla
Set Tab Stops Sekme Duraklarını Ayarla
Set Text Metni Ayarla
Set the current fill or stroke to the selected color Geçerli dolguyu veya konturu seçilen renge ayarla
Set the selected color to the current color Seçilen rengi geçerli renge ayarla
Set Zoom Yakınlaştırmayı Ayarla
Settings… Ayarlar…
Can't render this file because it is too large.
+1
View File
@@ -3507,6 +3507,7 @@ digits Malayalam Малаялам
Set Slice Rectangle Вказати прямокутник фрагмента
Set Tab Stops Задати табуляції
Set Text Задати текст
Set the current fill or stroke to the selected color Призначити вибраний колір поточній заливці або обведенню
Set the selected color to the current color Призначити поточний колір вибраному кольору
Set Zoom Задати масштаб
Settings… Параметри…
Can't render this file because it is too large.
+1
View File
@@ -3861,6 +3861,7 @@ mark-style Japanese Kiểu Nhật
Set Slice Rectangle Đặt hình chữ nhật lát cắt
Set Tab Stops Đặt vị trí tab
Set Text Đặt văn bản
Set the current fill or stroke to the selected color Đặt tô hoặc nét hiện tại thành màu đã chọn
Set the selected color to the current color Đặt màu đã chọn thành màu hiện tại
Set Zoom Đặt thu phóng
Settings Cài đặt
Can't render this file because it contains an unexpected character in line 205 and column 5.
+1
View File
@@ -3331,6 +3331,7 @@ digits Malayalam 马拉雅拉姆数字
Set Slice Rectangle 设置切片矩形
Set Tab Stops 设置制表位
Set Text 设置文本
Set the current fill or stroke to the selected color 将当前填色或描边设为选择的颜色
Set the selected color to the current color 将选择的颜色设为当前颜色
Set Zoom 设置缩放
Settings… 设置…
Can't render this file because it is too large.
+1
View File
@@ -4648,6 +4648,7 @@ digits Malayalam 馬來亞拉姆數字
Set Slice Rectangle 設定切片矩形
Set Tab Stops 設定定位點
Set Text 設定文字
Set the current fill or stroke to the selected color 將目前填色或筆畫設為選取的顏色
Set the selected color to the current color 將選取的顏色設為目前顏色
Set Zoom 設定縮放
Settings… 設定…
Can't render this file because it is too large.
+144 -1
View File
@@ -10,7 +10,7 @@ use vectorcraft_color::Color;
use vectorcraft_color::harmony::{Harmony, THEME_SIZE, move_on_wheel};
use vectorcraft_engine::cmd::colortheme::ColorTheme;
use super::{active_paint, c32, color_json, empty_state, pstate, set_pstate};
use super::{active_paint, c32, color_json, empty_state, proxy_cmd, pstate, set_pstate};
use crate::VectorcraftApp;
use crate::theme::{self, Tokens};
use crate::widgets::{self, menu_item};
@@ -126,6 +126,15 @@ fn add_draft_to_swatches(app: &mut VectorcraftApp, ctx: &egui::Context) {
app.run("swatch.newGroup", json!({ "name": name, "colors": colors_json(&d.colors), "keepModel": true })).ok();
}
/// Paint the active proxy (Fill or Stroke) with the selected colour of the theme being made, in its
/// own model: the selection and the new-art default take it in one paint command, so one undo
/// step, and no step when the art already has it. The theme stays as it is.
fn set_active_color(app: &mut VectorcraftApp, d: &Draft) {
if let Some(c) = d.colors.get(d.sel) {
app.run(proxy_cmd(app, false), json!({ "color": color_json(c), "keepModel": true })).ok();
}
}
pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
let ctx = ui.ctx().clone();
ui.horizontal(|ui| {
@@ -192,6 +201,11 @@ fn create(app: &mut VectorcraftApp, ui: &mut Ui) {
if let Some(c) = widgets::hex_field_named(ui, "ct-hex", Some(tl!("Color")), &hex).and_then(|h| Color::from_hex(&h)) {
d.set_selected(c);
}
let can_set = app.session.active().is_some() && d.colors.get(d.sel).is_some();
let tip = tl!("Set the current fill or stroke to the selected color");
if widgets::icon_button_enabled(ui, "paint-bucket", tip, false, can_set, 24.0).clicked() {
set_active_color(app, &d);
}
let current = active_paint(app).color();
if widgets::icon_button_enabled(ui, "pipette", tl!("Set the selected color to the current color"), false, current.is_some(), 24.0).clicked()
&& let Some(c) = current
@@ -454,6 +468,135 @@ mod tests {
frame(&mut app, &ctx);
}
const SET_ACTIVE: &str = "Set the current fill or stroke to the selected color";
/// A click on the panel button that screen readers name `label`. egui finds what the pointer is
/// over from the frame before, so the move gets a frame of its own.
fn click(app: &mut VectorcraftApp, ctx: &egui::Context, label: &str) {
crate::i18n::set_current(crate::i18n::Lang::EN);
ctx.enable_accesskit();
let mut time = ctx.input(|i| i.time);
let mut run = |app: &mut VectorcraftApp, events: Vec<egui::Event>| {
time += 0.1;
let screen = Rect::from_min_size(egui::Pos2::ZERO, vec2(320.0, 520.0));
let input = egui::RawInput { events, time: Some(time), screen_rect: Some(screen), ..Default::default() };
let mut out = ctx.run_ui(input, |ui| show(app, ui));
out.textures_delta.clear();
out
};
run(app, vec![]);
let out = run(app, vec![]);
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
let node = nodes.iter().find(|(_, n)| n.label() == Some(label));
let b = node.unwrap_or_else(|| panic!("nothing named {label:?}")).1.bounds().expect("bounds");
let at = egui::pos2((b.x0 + b.x1) as f32 * 0.5, (b.y0 + b.y1) as f32 * 0.5);
let button =
|pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
run(app, vec![egui::Event::PointerMoved(at)]);
run(app, vec![button(true)]);
run(app, vec![button(false)]);
}
/// A Custom theme of five different colours with the third selected.
fn five_colors(ctx: &egui::Context) -> Draft {
let colors = ["#cc2200", "#22aa44", "#3355dd", "#ddbb11", "#884499"].map(|h| Color::from_hex(h).unwrap()).to_vec();
let d = Draft { colors, rule: None, sel: 2, name: "Mine".into(), editing: None };
set_draft(ctx, d.clone());
d
}
/// The fill and stroke paints of object `id`.
fn paints(app: &VectorcraftApp, id: vectorcraft_doc::NodeId) -> (vectorcraft_color::Paint, vectorcraft_color::Paint) {
let n = app.session.doc().unwrap().doc.node(id).unwrap();
(n.appearance.fill().unwrap().paint.clone(), n.appearance.stroke().unwrap().paint.clone())
}
fn undo_len(app: &VectorcraftApp) -> usize {
app.session.doc().unwrap().history.undo.len()
}
/// Screen readers name the Set Active Color button by its tool tip; it is off without a document.
#[test]
fn set_active_color_is_named_and_needs_a_document() {
use crate::widgets::accessibility_tests::{named, tree};
let mut app = app();
let shown = tree(|ui| show(&mut app, ui));
assert_eq!(named(&shown, SET_ACTIVE).role(), egui::accesskit::Role::Button);
assert!(!named(&shown, SET_ACTIVE).is_disabled());
let mut none = VectorcraftApp::new(Session::new(), Default::default());
let shown = tree(|ui| show(&mut none, ui));
assert!(named(&shown, SET_ACTIVE).is_disabled(), "no document: nothing to paint");
}
/// Set Active Color paints the active proxy of the selection with the selected theme colour,
/// one undo step a click, none when the art already has it, and leaves the theme as it is.
#[test]
fn set_active_color_paints_the_active_proxy_with_the_selected_color() {
let mut app = app();
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap();
let id = app.session.doc().unwrap().selection.objects[0];
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let d = five_colors(&ctx);
let (_, stroke) = paints(&app, id);
let undo = undo_len(&app);
click(&mut app, &ctx, SET_ACTIVE);
assert_eq!(paints(&app, id), (vectorcraft_color::Paint::solid(d.colors[2]), stroke.clone()), "the selected colour, not the first");
assert_eq!(undo_len(&app), undo + 1, "one undo step");
click(&mut app, &ctx, SET_ACTIVE);
assert_eq!(undo_len(&app), undo + 1, "no step when the fill already has the colour");
// With the Stroke proxy in front, the stroke takes the colour and the fill stays.
app.run("paint.toggleActive", json!({"fill": false})).unwrap();
set_draft(&ctx, Draft { sel: 3, ..d.clone() });
click(&mut app, &ctx, SET_ACTIVE);
let solid = |i: usize| vectorcraft_color::Paint::solid(d.colors[i]);
assert_eq!(paints(&app, id), (solid(2), solid(3)));
assert_eq!(undo_len(&app), undo + 2);
app.run("edit.undo", json!({})).unwrap();
assert_eq!(paints(&app, id), (solid(2), stroke.clone()), "one undo takes the stroke back");
app.run("edit.redo", json!({})).unwrap();
assert_eq!(paints(&app, id), (solid(2), solid(3)));
// The theme being made and the saved themes stay as they were.
assert_eq!(draft(&app, &ctx), Draft { sel: 3, ..d.clone() });
assert!(themes(&app).is_empty());
// The reverse pipette paints nothing.
let undo = undo_len(&app);
click(&mut app, &ctx, "Set the selected color to the current color");
assert_eq!((paints(&app, id), undo_len(&app)), ((solid(2), solid(3)), undo));
}
/// With nothing selected, Set Active Color sets the new-art default alone, without an undo step,
/// and new art takes it.
#[test]
fn set_active_color_with_nothing_selected_sets_the_default_for_new_art() {
let mut app = app();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let d = five_colors(&ctx);
let undo = undo_len(&app);
click(&mut app, &ctx, SET_ACTIVE);
assert_eq!(app.session.paint.fill, vectorcraft_color::Paint::solid(d.colors[2]));
assert_eq!(undo_len(&app), undo, "no art changed");
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap();
let id = app.session.doc().unwrap().selection.objects[0];
assert_eq!(paints(&app, id).0, vectorcraft_color::Paint::solid(d.colors[2]));
}
/// In a CMYK document Set Active Color keeps an RGB theme colour in RGB.
#[test]
fn set_active_color_keeps_the_model_in_a_cmyk_document() {
let mut app = app();
app.run("file.documentColorMode", json!({"mode": "cmyk"})).unwrap();
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap();
let id = app.session.doc().unwrap().selection.objects[0];
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let d = five_colors(&ctx);
click(&mut app, &ctx, SET_ACTIVE);
assert_eq!(paints(&app, id).0.color(), Some(d.colors[2]));
assert!(matches!(d.colors[2], Color::Rgb { .. }));
}
/// In a CMYK document the theme being made goes to Swatches with its colors in their own model.
#[test]
fn the_theme_being_made_keeps_its_model_in_a_cmyk_document() {
+3 -1
View File
@@ -1099,7 +1099,9 @@ Color Themes (local only: no online service) keeps five-colour themes in the pre
harmony rule makes from a base colour (base first; `name?` defaults to "Theme N", `replace: "<name>"` overwrites
that theme in place). `colorTheme.list` answers `{themes: [{name, colors: [hex], keys: [colour keys], rule?}]}`,
`colorTheme.delete {name}` removes one and `colorTheme.addToSwatches {name}` adds one to the Swatches panel as a
colour group (one undo step).
colour group (one undo step). The Create tab's Set the current fill or stroke to the selected color button runs
`paint.setFill` (or `paint.setStroke` with the Stroke proxy in front) with the selected colour and `keepModel: true`;
a script does the same with those commands.
```json
{"name":"run_command","arguments":{"command":"colorTheme.save","params":{"color":"#2266aa","rule":"splitComplementary","name":"Harbor"}}}
+1
View File
@@ -1776,6 +1776,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only.
- **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90).
- **Swatches made from a shown color in a CMYK document:** the Color panel menu's Create New Swatch, an Alt-click on the Swatches panel's New Swatch button, the New Swatch dialog for a gradient, a Fill or Stroke proxy or the Gradient panel's thumbnail dropped on the Swatches panel (or Alt-dropped on a swatch of its kind), and the Gradient panel's Add to Swatches and Save to Swatches keep each color's model, as the Color Guide's and Color Themes' saved colors do: an RGB object's color gives an RGB swatch, and a gradient's RGB stops stay RGB.
- **Color Themes Set Active Color:** a button on the Color Themes panel's Create tab makes the selected theme color the current color, the action the [help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=222) describes for creating a color theme. VectorCraft's own rules: the color goes to the proxy in front (Fill or Stroke), on the selection and the default for new art, in its own color model, through `paint.setFill` or `paint.setStroke`; a click is one undo step, a click that changes no art adds none, and the button is off without a document. Tests: `set_active_color_*` in `crates/ui-egui/src/panels/color_themes.rs`.
- **Sample Color from Screen:** an eyedropper button in the Color Picker and `ui.sampleScreenColor` (which can be given a key in Keyboard Shortcuts) pick a color anywhere on the screen with the system's sampler: `NSColorSampler` on macOS, the XDG desktop portal's [PickColor](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Screenshot.html) on Linux, a still copy of every monitor under a crosshair on Windows, and the EyeDropper API in browsers that have it. The color becomes the fill or the stroke as one undo step, or the Color Picker's color, converted from display sRGB into the working RGB space. On Linux, a session without a portal that has PickColor, a portal that does not return from the call within 25 seconds (VectorCraft's own limit) or leaves the bus before it answers, and a portal that ends the request another way each show a status message and end the wait. On Windows, the copy is read as sRGB, so the colors of HDR and wide-gamut displays are not converted; Escape, a click of another mouse button or switching to another window cancels (VectorCraft's own rules). The BSDs and other browsers have no sampler yet; the button is gray there.
- **Color Guide color groups:** with variation cells selected, the Color Guide's Save Color Group to Swatches button saves those cells as one swatch group, and with none selected it saves the harmony colors, as the [help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf) describes saving several selected variations together (printed page 135). The group takes the cells in grid order (row by row, left to right, each cell once), is named after the harmony rule and is one undo step; these are VectorCraft's own rules. A selection lasts until the base, the Color Guide Options, the variation mode, the harmony rule, the library limit or the colors the grid shows (for example after a new swatch while the guide is limited to the document's swatches) change.
- **Color Guide colors dragged to Swatches:** a variation cell dragged from the Color Guide onto the Swatches panel's list becomes a swatch of that color, as the [help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf) describes for saving variations as individual swatches (printed page 135). In VectorCraft a harmony strip color drags the same way, a drag carries only the grabbed color (the selected cells stay selected and the selection is not saved), it carries the color the cell shows (snapped to the Limit to Library colors), keeps the color's model and does not paint the selected art; the swatch follows the panel's rules for a dropped color (`swatch.new`, one undo step, a color that is already a swatch is added again under another name, a drop on a color group joins it). These are VectorCraft's own rules. Tests: `a_dragged_guide_color_carries_its_color_and_applies_nothing` and `a_guide_color_dragged_onto_the_swatches_panel_becomes_a_swatch` in `crates/ui-egui/src/panels/color_guide.rs`.