Merge pull request #7740 from dotCooCoo/feat/assign-profile-choices

Color management: Assign Profile offers Don't Color Manage, the working space or a profile
This commit is contained in:
BFlat
2026-11-15 11:37:43 +07:00
committed by GitHub
32 changed files with 243 additions and 9 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Assign Profile…",
["Edit"],
None,
"{rgb?: profile|null, cmyk?: profile|null} tag the document with profiles (color numbers are kept; null: the working space). Colors then show and convert through the profiles assigned; the working spaces stay as edit.colorSettings set them → {rgb, cmyk}",
"{rgb?: profile|null, cmyk?: profile|null} tag the document with profiles (color numbers are kept; null: no profile, Don't Color Manage This Document, so colors show through the working space; the working space's name: that profile stays assigned when the working space changes). Colors then show and convert through the profiles assigned; the working spaces stay as edit.colorSettings set them → {rgb, cmyk}",
has_doc,
assign_profile
),
+3
View File
@@ -3956,6 +3956,9 @@ digits Malayalam Малаялам
Working CMYK Работен CMYK
Working CMYK (don't tag) Работен CMYK (без етикет)
Working RGB (don't tag) Работен RGB (без етикет)
Don't Color Manage This Document Без управление на цветовете за този документ
Working RGB: {name} Работен RGB: {name}
Working CMYK: {name} Работен CMYK: {name}
Workspace Работно пространство
Workspace {i} Работно пространство {i}
Wrinkle Tool Инструмент „Набръчкване“
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2146,6 +2146,9 @@ digits Malayalam Malajalam
Use Black Point Compensation Koristi kompenzaciju crne tačke
Working CMYK (don't tag) Radni CMYK (bez oznake)
Working RGB (don't tag) Radni RGB (bez oznake)
Don't Color Manage This Document Ne upravljaj bojama ovog dokumenta
Working RGB: {name} Radni RGB: {name}
Working CMYK: {name} Radni CMYK: {name}
{name} (spot) {name} (spot)
Add to Profiles… Dodaj u profile…
Align Stroke to Center Poravnaj potez po sredini
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5162,6 +5162,9 @@ digits Malayalam Malaiàlam
Working CMYK CMYK de treball
Working CMYK (don't tag) CMYK de treball (sense etiquetar)
Working RGB (don't tag) RGB de treball (sense etiquetar)
Don't Color Manage This Document No gestionis el color d'aquest document
Working RGB: {name} RGB de treball: {name}
Working CMYK: {name} CMYK de treball: {name}
Working RGB RGB de treball
Workspace Espai de treball
Workspace {i} Espai de treball {i}
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2177,6 +2177,9 @@ digits Malayalam Malajálamské
Use Black Point Compensation Použít kompenzaci černého bodu
Working CMYK (don't tag) Pracovní CMYK (neoznačovat)
Working RGB (don't tag) Pracovní RGB (neoznačovat)
Don't Color Manage This Document Nespravovat barvy tohoto dokumentu
Working RGB: {name} Pracovní RGB: {name}
Working CMYK: {name} Pracovní CMYK: {name}
{name} (spot) {name} (přímá)
Add to Profiles… Přidat do profilů…
Align Stroke to Center Zarovnat tah na střed
Can't render this file because it is too large.
+3
View File
@@ -2586,6 +2586,9 @@ digits Malayalam Malayalam
Use Black Point Compensation Brug sortpunktskompensation
Working CMYK (don't tag) Arbejds-CMYK (mærk ikke)
Working RGB (don't tag) Arbejds-RGB (mærk ikke)
Don't Color Manage This Document Farvestyr ikke dette dokument
Working RGB: {name} Arbejds-RGB: {name}
Working CMYK: {name} Arbejds-CMYK: {name}
{name} (spot) {name} (spotfarve)
Add to Profiles… Tilføj til profiler…
Align Stroke to Center Justér kontur til midten
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -3966,6 +3966,9 @@ effect Points Punkte
Working CMYK CMYK-Arbeitsfarbraum
Working CMYK (don't tag) CMYK-Arbeitsfarbraum (nicht kennzeichnen)
Working RGB (don't tag) RGB-Arbeitsfarbraum (nicht kennzeichnen)
Don't Color Manage This Document Kein Farbmanagement für dieses Dokument
Working RGB: {name} RGB-Arbeitsfarbraum: {name}
Working CMYK: {name} CMYK-Arbeitsfarbraum: {name}
Workspace Arbeitsbereich
Workspace {i} Arbeitsbereich {i}
Wrinkle Tool Zerknittern-Werkzeug
Can't render this file because it is too large.
+3
View File
@@ -4434,6 +4434,9 @@ digits Malayalam Μαλαγιάλαμ
Width Tool Πλάτος (Width Tool)
Working CMYK (don't tag) Χώρος εργασίας CMYK (χωρίς ετικέτα)
Working RGB (don't tag) Χώρος εργασίας RGB (χωρίς ετικέτα)
Don't Color Manage This Document Χωρίς διαχείριση χρωμάτων για αυτό το έγγραφο
Working RGB: {name} Χώρος εργασίας RGB: {name}
Working CMYK: {name} Χώρος εργασίας CMYK: {name}
Workspace {i} Χώρος εργασίας {i}
Wrinkle Tool Πτυχώσεις (Wrinkle Tool)
Write Layers Εγγραφή επιπέδων
Can't render this file because it is too large.
+3
View File
@@ -4048,6 +4048,9 @@ digits Malayalam Malayálam
Working CMYK CMYK de trabajo
Working CMYK (don't tag) CMYK de trabajo (sin etiquetar)
Working RGB (don't tag) RGB de trabajo (sin etiquetar)
Don't Color Manage This Document No gestionar el color de este documento
Working RGB: {name} RGB de trabajo: {name}
Working CMYK: {name} CMYK de trabajo: {name}
Workspace Espacio de trabajo
Workspace {i} Espacio de trabajo {i}
Wrinkle Tool Herramienta Arrugar
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2138,6 +2138,9 @@ digits Malayalam Malajalam
Use Black Point Compensation Käytä mustan pisteen kompensointia
Working CMYK (don't tag) Työ-CMYK (ei tunnistetta)
Working RGB (don't tag) Työ-RGB (ei tunnistetta)
Don't Color Manage This Document Älä hallitse tämän asiakirjan värejä
Working RGB: {name} Työ-RGB: {name}
Working CMYK: {name} Työ-CMYK: {name}
{name} (spot) {name} (spottiväri)
Add to Profiles… Lisää profiileihin…
Align Stroke to Center Tasaa viiva keskelle
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -4039,6 +4039,9 @@ digits Malayalam Malayalam
Working CMYK CMJN de travail
Working CMYK (don't tag) CMJN de travail (sans balise)
Working RGB (don't tag) RVB de travail (sans balise)
Don't Color Manage This Document Ne pas gérer les couleurs de ce document
Working RGB: {name} RVB de travail : {name}
Working CMYK: {name} CMJN de travail : {name}
Workspace Espace de travail
Workspace {i} Espace de travail {i}
Wrinkle Tool Outil Fronces
Can't render this file because it is too large.
+3
View File
@@ -1029,6 +1029,7 @@
Document model દસ્તાવેજ મોડેલ
Document open password દસ્તાવેજ ખોલવાનો પાસવર્ડ
Documents you create appear here. તમે બનાવેલા દસ્તાવેજો અહીં દેખાશે.
Don't Color Manage This Document આ દસ્તાવેજનું રંગ સંચાલન કરશો નહીં
Don't Relink ફરીથી લિંક કરશો નહીં
Don't Save સાચવશો નહીં
Don't Show Center સેન્ટર બતાવશો નહીં
@@ -4178,6 +4179,8 @@
Word Spacing: શબ્દ અંતર:
Words Longer Than: આનાથી લાંબા શબ્દો:
Working CMYK કાર્યકારી CMYK
Working CMYK: {name} કાર્યકારી CMYK: {name}
Working RGB: {name} કાર્યકારી RGB: {name}
Workspace વર્કસ્પેસ
Wrinkle કરચલી
Wrinkle Tool કરચલી ટૂલ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+3
View File
@@ -5574,6 +5574,9 @@ antiAlias Sharp शार्प
Working CMYK वर्किंग CMYK
Working CMYK (don't tag) कार्य CMYK (टैग नहीं)
Working RGB (don't tag) कार्य RGB (टैग नहीं)
Don't Color Manage This Document इस दस्तावेज़ का रंग प्रबंधन न करें
Working RGB: {name} कार्य RGB: {name}
Working CMYK: {name} कार्य CMYK: {name}
Working RGB वर्किंग RGB
Workspace वर्कस्पेस
Workspace {i} वर्कस्पेस {i}
Can't render this file because it is too large.
+3
View File
@@ -4789,6 +4789,9 @@ mark-style Japanese Japán
Working CMYK Munka-CMYK
Working CMYK (don't tag) Munka-CMYK (címke nélkül)
Working RGB (don't tag) Munka-RGB (címke nélkül)
Don't Color Manage This Document Ne legyen színkezelés ebben a dokumentumban
Working RGB: {name} Munka-RGB: {name}
Working CMYK: {name} Munka-CMYK: {name}
Working RGB Munka-RGB
Workspace Munkaterület
Workspace {i} Munkaterület {i}
Can't render this file because it is too large.
+3
View File
@@ -1977,6 +1977,9 @@ digits Malayalam Malayalam
Use Black Point Compensation Gunakan kompensasi titik hitam
Working CMYK (don't tag) CMYK kerja (tanpa tag)
Working RGB (don't tag) RGB kerja (tanpa tag)
Don't Color Manage This Document Jangan kelola warna dokumen ini
Working RGB: {name} RGB kerja: {name}
Working CMYK: {name} CMYK kerja: {name}
{name} (spot) {name} (spot)
Add to Profiles… Tambahkan ke profil…
Align Stroke to Center Ratakan stroke ke tengah
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
1977
1978
1979
1980
1981
1982
1983
1984
1985
+3
View File
@@ -4095,6 +4095,9 @@ digits Malayalam Malayalam
Working CMYK CMYK di lavoro
Working CMYK (don't tag) CMYK di lavoro (senza tag)
Working RGB (don't tag) RGB di lavoro (senza tag)
Don't Color Manage This Document Non gestire il colore di questo documento
Working RGB: {name} RGB di lavoro: {name}
Working CMYK: {name} CMYK di lavoro: {name}
Workspace Area di lavoro
Workspace {i} Area di lavoro {i}
Wrinkle Tool Strumento Grinza
Can't render this file because it is too large.
+3
View File
@@ -4123,6 +4123,9 @@ file-filter Templates テンプレート
Windows Windows
Working CMYK (don't tag) 作業用 CMYK (タグなし)
Working RGB (don't tag) 作業用 RGB (タグなし)
Don't Color Manage This Document このドキュメントにカラーマネジメントを適用しない
Working RGB: {name} 作業用 RGB: {name}
Working CMYK: {name} 作業用 CMYK: {name}
Workspace {i} ワークスペース {i}
Yellow イエロー
[Normal Character Style] [標準文字スタイル]
Can't render this file because it is too large.
+3
View File
@@ -1906,6 +1906,9 @@ digits Malayalam მალაიალამური
Use Black Point Compensation შავი წერტილის კომპენსაციის გამოყენება
Working CMYK (don't tag) სამუშაო CMYK (ტეგის გარეშე)
Working RGB (don't tag) სამუშაო RGB (ტეგის გარეშე)
Don't Color Manage This Document ამ დოკუმენტის ფერების მართვის გარეშე
Working RGB: {name} სამუშაო RGB: {name}
Working CMYK: {name} სამუშაო CMYK: {name}
{name} (spot) {name} (სპოტ)
Add to Profiles… პროფილებში დამატება…
Align Stroke to Center კონტურის ცენტრზე სწორება
Can't render this file because it is too large.
+3
View File
@@ -4111,6 +4111,9 @@ file-filter Templates 템플릿
Windows Windows
Working CMYK (don't tag) 작업용 CMYK (태그 안 함)
Working RGB (don't tag) 작업용 RGB (태그 안 함)
Don't Color Manage This Document 이 문서에 색상 관리 안 함
Working RGB: {name} 작업용 RGB: {name}
Working CMYK: {name} 작업용 CMYK: {name}
Workspace {i} 작업 영역 {i}
Yellow 노랑
[Normal Character Style] [기본 문자 스타일]
Can't render this file because it is too large.
+3
View File
@@ -2495,6 +2495,9 @@ digits Malayalam Malayalam
Use Black Point Compensation Zwartpuntcompensatie gebruiken
Working CMYK (don't tag) Werk-CMYK (niet taggen)
Working RGB (don't tag) Werk-RGB (niet taggen)
Don't Color Manage This Document Geen kleurbeheer voor dit document
Working RGB: {name} Werk-RGB: {name}
Working CMYK: {name} Werk-CMYK: {name}
{name} (spot) {name} (spotkleur)
Add to Profiles… Toevoegen aan profielen…
Align Stroke to Center Lijn in het midden uitlijnen
Can't render this file because it is too large.
+3
View File
@@ -2095,6 +2095,9 @@ digits Malayalam Malajalam
Use Black Point Compensation Użyj kompensacji punktu czerni
Working CMYK (don't tag) Roboczy CMYK (bez znacznika)
Working RGB (don't tag) Roboczy RGB (bez znacznika)
Don't Color Manage This Document Nie zarządzaj kolorem tego dokumentu
Working RGB: {name} Roboczy RGB: {name}
Working CMYK: {name} Roboczy CMYK: {name}
{name} (spot) {name} (dodatkowy)
Add to Profiles… Dodaj do profili…
Align Stroke to Center Wyrównaj obrys do środka
Can't render this file because it is too large.
+3
View File
@@ -5318,6 +5318,9 @@ axis Both Ambos
Windows Windows
Working CMYK (don't tag) CMYK de Trabalho (não marcar)
Working RGB (don't tag) RGB de Trabalho (não marcar)
Don't Color Manage This Document Não gerenciar as cores deste documento
Working RGB: {name} RGB de Trabalho: {name}
Working CMYK: {name} CMYK de Trabalho: {name}
Workspace {i} Espaço de Trabalho {i}
Yellow Amarelo
[Normal Character Style] [Estilo de Caractere Normal]
Can't render this file because it is too large.
+3
View File
@@ -4080,6 +4080,9 @@ digits Malayalam Малаялам
Working CMYK Рабочий CMYK
Working CMYK (don't tag) Рабочий CMYK (без пометки)
Working RGB (don't tag) Рабочий RGB (без пометки)
Don't Color Manage This Document Не управлять цветом этого документа
Working RGB: {name} Рабочий RGB: {name}
Working CMYK: {name} Рабочий CMYK: {name}
Workspace Рабочая среда
Workspace {i} Рабочая среда {i}
Wrinkle Tool Инструмент «Морщины»
Can't render this file because it is too large.
+3
View File
@@ -3969,6 +3969,9 @@ digits Malayalam Malayalam
Working CMYK Arbets-CMYK
Working CMYK (don't tag) Arbets-CMYK (tagga inte)
Working RGB (don't tag) Arbets-RGB (tagga inte)
Don't Color Manage This Document Färghantera inte det här dokumentet
Working RGB: {name} Arbets-RGB: {name}
Working CMYK: {name} Arbets-CMYK: {name}
Workspace Arbetslayout
Workspace {i} Arbetslayout {i}
Wrinkle Tool Skrynkelverktyg
Can't render this file because it is too large.
+3
View File
@@ -3828,6 +3828,9 @@ digits Malayalam Malayalam
Working CMYK CMYK'de çalışıyor
Working CMYK (don't tag) CMYK çalışıyor (etiketlemeyin)
Working RGB (don't tag) Çalışan RGB (etiketlemeyin)
Don't Color Manage This Document Bu belgede renk yönetimi yapma
Working RGB: {name} Çalışma RGB'si: {name}
Working CMYK: {name} Çalışma CMYK'sı: {name}
Workspace Çalışma Alanı
Workspace {i} Çalışma Alanı {i}
Wrinkle Tool Kırışıklık Aracı
Can't render this file because it is too large.
+3
View File
@@ -4088,6 +4088,9 @@ effect Points Точки
Working CMYK Робочий CMYK
Working CMYK (don't tag) Робочий CMYK (без позначки)
Working RGB (don't tag) Робочий RGB (без позначки)
Don't Color Manage This Document Не керувати кольором цього документа
Working RGB: {name} Робочий RGB: {name}
Working CMYK: {name} Робочий CMYK: {name}
Workspace Робоче середовище
Workspace {i} Робоче середовище {i}
Wrinkle Tool Інструмент «Зморшки»
Can't render this file because it is too large.
+3
View File
@@ -4463,6 +4463,9 @@ mark-style Japanese Kiểu Nhật
Working CMYK CMYK làm việc
Working CMYK (don't tag) CMYK làm việc (không gắn thẻ)
Working RGB (don't tag) RGB làm việc (không gắn thẻ)
Don't Color Manage This Document Không quản lý màu cho tài liệu này
Working RGB: {name} RGB làm việc: {name}
Working CMYK: {name} CMYK làm việc: {name}
Workspace Không gian làm việc
Workspace {i} Không gian làm việc {i}
Wrinkle Tool Công cụ nhăn
Can't render this file because it contains an unexpected character in line 204 and column 5.
+3
View File
@@ -3927,6 +3927,9 @@ digits Malayalam 马拉雅拉姆数字
Working CMYK 工作 CMYK
Working CMYK (don't tag) 工作 CMYK (不加标签)
Working RGB (don't tag) 工作 RGB (不加标签)
Don't Color Manage This Document 不对此文档进行色彩管理
Working RGB: {name} 工作 RGB:{name}
Working CMYK: {name} 工作 CMYK:{name}
Workspace 工作区
Workspace {i} 工作区 {i}
Wrinkle Tool 褶皱工具
Can't render this file because it is too large.
+3
View File
@@ -5190,6 +5190,9 @@ digits Malayalam 馬來亞拉姆數字
Working CMYK 使用中的 CMYK
Working CMYK (don't tag) 工作 CMYK (不加標記)
Working RGB (don't tag) 工作 RGB (不加標記)
Don't Color Manage This Document 不對此文件進行色彩管理
Working RGB: {name} 工作 RGB:{name}
Working CMYK: {name} 工作 CMYK:{name}
Workspace 工作區
Workspace {i} 工作區 {i}
Wrinkle Tool 皺摺工具
Can't render this file because it is too large.
+152 -8
View File
@@ -147,16 +147,99 @@ fn settings_rows(app: &mut VectorcraftApp, ui: &mut Ui) {
}
}
});
if let Some(d) = app.session.active() {
let (_, cmyk) = vectorcraft_engine::cmd::colormgmt::doc_profiles(&d.doc);
const WORKING: &str = "Working CMYK (don't tag)";
ui.horizontal(|ui| {
ui.label(tl!("Assign:"));
if let Some(n) = profile_dropdown(ui, "cms-assign", cmyk.as_deref().unwrap_or(WORKING), ProfileKind::Cmyk, Some(WORKING)) {
let v = if n == WORKING { Value::Null } else { Value::String(n) };
run(app, "edit.assignProfile", json!({ "cmyk": v }));
if let Some(row) = app.session.active().map(|d| AssignRow::of(&d.doc)) {
assign_rows(app, ui, &row);
}
}
/// Edit › Assign Profile…'s three choices for the active document's color mode.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum AssignChoice {
/// Don't Color Manage This Document: no profile, so the colors show through the working space.
None,
/// The working space of the mode, assigned to the document as its profile.
Working,
/// Another profile of the mode's kind.
Profile,
}
/// What the Assign rows show for a document: the profile of its color mode (`key` is the
/// `edit.assignProfile` param), the working space of that mode, and the other profiles of that kind.
#[derive(Debug)]
struct AssignRow {
key: &'static str,
mode: vectorcraft_doc::ColorMode,
assigned: Option<String>,
working: String,
others: Vec<String>,
}
impl AssignRow {
fn of(doc: &vectorcraft_doc::Document) -> Self {
let (rgb, cmyk) = vectorcraft_engine::cmd::colormgmt::doc_profiles(doc);
let st = cms::working_settings();
let (key, kind, assigned, working) = match doc.color_mode {
vectorcraft_doc::ColorMode::Rgb => ("rgb", ProfileKind::Rgb, rgb, st.rgb),
vectorcraft_doc::ColorMode::Cmyk => ("cmyk", ProfileKind::Cmyk, cmyk, st.cmyk),
};
let working = cms::canonical_name(&working).to_string();
let others = cms::profiles().into_iter().filter(|p| p.kind == kind && p.name != working).map(|p| p.name).collect();
AssignRow { key, mode: doc.color_mode, assigned, working, others }
}
fn choice(&self) -> AssignChoice {
match &self.assigned {
None => AssignChoice::None,
Some(n) if *n == self.working => AssignChoice::Working,
Some(_) => AssignChoice::Profile,
}
}
/// The `edit.assignProfile` params for `choice` (with `profile`, the profile picked for
/// [`AssignChoice::Profile`], else the first of the list), or `None` when the document already
/// has it.
fn params(&self, choice: AssignChoice, profile: Option<&str>) -> Option<Value> {
let v = match choice {
AssignChoice::None => Value::Null,
AssignChoice::Working => json!(self.working),
AssignChoice::Profile => json!(profile.or(self.others.first().map(String::as_str))?),
};
(v != json!(self.assigned)).then(|| json!({ self.key: v }))
}
}
/// The Assign rows: Don't Color Manage This Document, the working space of the document's color
/// mode, and Profile with a list of the other profiles of that kind. A pick runs `edit.assignProfile`.
fn assign_rows(app: &mut VectorcraftApp, ui: &mut Ui, row: &AssignRow) {
let choice = row.choice();
let mut pick = None;
ui.label(tl!("Assign:"));
if widgets::radio(ui, tl!("Don't Color Manage This Document"), choice == AssignChoice::None, true) {
pick = row.params(AssignChoice::None, None);
}
let working = match row.mode {
vectorcraft_doc::ColorMode::Rgb => tl!("Working RGB: {name}"),
vectorcraft_doc::ColorMode::Cmyk => tl!("Working CMYK: {name}"),
};
let working = crate::i18n::fmt(working, &[("name", &row.working)]);
if widgets::radio(ui, &working, choice == AssignChoice::Working, true) {
pick = row.params(AssignChoice::Working, None);
}
ui.horizontal(|ui| {
let on = choice == AssignChoice::Profile;
let shown = if on { row.assigned.as_deref() } else { row.others.first().map(String::as_str) };
if widgets::radio(ui, tl!("Profile:"), on, !row.others.is_empty()) {
pick = row.params(AssignChoice::Profile, shown);
}
let refs: Vec<&str> = row.others.iter().map(String::as_str).collect();
ui.add_enabled_ui(!refs.is_empty(), |ui| {
if let Some(i) = widgets::dropdown_names(ui, "cms-assign", shown.unwrap_or_default(), &refs, 210.0) {
pick = row.params(AssignChoice::Profile, refs.get(i).copied());
}
});
});
if let Some(p) = pick {
run(app, "edit.assignProfile", p);
}
}
@@ -235,6 +318,67 @@ mod tests {
assert!(panel.iter().all(|(id, _)| cms::ProofTarget::parse(id).is_some_and(|t| t.id() == *id)));
}
/// Assign Profile's three choices: no profile, the working space assigned as the profile, or
/// another profile; a choice the document already has runs nothing.
#[test]
fn assign_choices_give_the_profile_params_of_the_color_mode() {
let row = |assigned: Option<&str>| AssignRow {
key: "rgb",
mode: vectorcraft_doc::ColorMode::Rgb,
assigned: assigned.map(str::to_string),
working: "W".into(),
others: vec!["A".into(), "B".into()],
};
assert_eq!(row(None).choice(), AssignChoice::None);
assert_eq!(row(Some("W")).choice(), AssignChoice::Working);
assert_eq!(row(Some("B")).choice(), AssignChoice::Profile);
assert_eq!(row(None).params(AssignChoice::None, None), None);
assert_eq!(row(Some("B")).params(AssignChoice::None, None), Some(json!({"rgb": null})));
assert_eq!(row(None).params(AssignChoice::Working, None), Some(json!({"rgb": "W"})));
assert_eq!(row(Some("W")).params(AssignChoice::Working, None), None);
assert_eq!(row(None).params(AssignChoice::Profile, None), Some(json!({"rgb": "A"})));
assert_eq!(row(Some("W")).params(AssignChoice::Profile, Some("B")), Some(json!({"rgb": "B"})));
assert_eq!(row(Some("B")).params(AssignChoice::Profile, Some("B")), None);
let none = AssignRow { others: vec![], ..row(None) };
assert_eq!(none.params(AssignChoice::Profile, None), None, "no other profile to pick");
}
/// The Assign rows follow the document's color mode: an RGB document lists the RGB working space
/// and the RGB profiles and assigns its RGB profile, a CMYK document the CMYK ones, and the other
/// model's profile stays as it was.
#[test]
fn assign_rows_follow_the_document_color_mode() {
fn texts(s: &egui::Shape, out: &mut Vec<String>) {
match s {
egui::Shape::Text(t) => out.push(t.galley.text().to_string()),
egui::Shape::Vec(v) => v.iter().for_each(|s| texts(s, out)),
_ => {}
}
}
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({})).unwrap();
for (mode, key, kind, other) in [("rgb", "rgb", ProfileKind::Rgb, "cmyk"), ("cmyk", "cmyk", ProfileKind::Cmyk, "rgb")] {
app.run("edit.assignProfile", json!({"rgb": null, "cmyk": null})).unwrap();
app.run("file.documentColorMode", json!({"mode": mode, "convert": false})).unwrap();
let row = AssignRow::of(&app.session.active().unwrap().doc);
assert_eq!((row.key, row.choice()), (key, AssignChoice::None));
assert!(!row.others.is_empty() && !row.others.contains(&row.working));
assert!(row.others.iter().chain([&row.working]).all(|n| cms::profile(n).is_some_and(|p| p.kind == kind)), "{row:?}");
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| settings_rows(&mut app, ui));
out.textures_delta.clear();
let mut shown = vec![];
out.shapes.iter().for_each(|c| texts(&c.shape, &mut shown));
let working = format!("Working {}: {}", mode.to_uppercase(), row.working);
assert!(shown.contains(&working) && shown.iter().any(|t| t == "Don't Color Manage This Document"), "{shown:?}");
app.run("edit.assignProfile", row.params(AssignChoice::Profile, None).unwrap()).unwrap();
let doc = &app.session.active().unwrap().doc;
let (rgb, cmyk) = vectorcraft_engine::cmd::colormgmt::doc_profiles(doc);
let (mine, theirs) = if key == "rgb" { (rgb, cmyk) } else { (cmyk, rgb) };
assert_eq!((mine.as_deref(), theirs), (row.others.first().map(String::as_str), None), "{other} stays untagged");
}
}
/// #6419: Edit › Assign Profile… and Color Settings… show the panel scrolled to its Color
/// Settings section, which a window shorter than the panel (a floated panel stops at 320
/// points) otherwise shows only after scrolling past the plates and Proof Setup. Once: a
+5
View File
@@ -1060,6 +1060,11 @@ styles and brushes.
`color.removeProfile`, `view.proofSetup`, `view.proofColors`, `view.overprintPreview`, `view.separationsPreview` and
`swatch.setSpot` reject a param of the wrong type, such as `"bpc": "no"`, `"on": 1`, `"to": 5` or `"colors": "#fff"`,
and change nothing. Omitting a param or giving null keeps its default.
The Separations panel's Assign rows (where Edit › Assign Profile… goes) act on the profile of the document's color
mode: Don't Color Manage This Document runs `edit.assignProfile` with null for that model (no profile, so the colors
show through the working space), Working RGB or Working CMYK with the working space's name (that profile stays
assigned when the working space changes), and Profile with another profile of that kind. A choice the document
already has runs nothing, and the other model's profile stays as it is.
SVG import keeps what the canvas edits live. `<pattern>` becomes a pattern swatch. A `<symbol>` with `<use>` becomes a
symbol (named after its `data-name`, else its id) with an instance per `<use>`; a `<use>` that shows it differently
+1
View File
@@ -746,6 +746,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Document Setup modal handoff:** Document Setup → Edit Artboards applies valid settings, closes the dialog and activates the Artboard tool. Pointer-click tests cover successful handoff, invalid settings, OK, Cancel and Undo in `dialogs/document_setup.rs`.
- **Document Setup › Color:** a Color tab shows the document color mode (RGB Color or CMYK Color), a Convert to CMYK or Convert to RGB box for a mode change (cleared: the colors keep their numbers), and the RGB and CMYK profiles assigned to the document, with a working-space entry for none. OK runs `edit.assignProfile` and then `file.documentColorMode` with the dialog's other changes in one `command.batch`, and the document's changes are one undo step. An unchanged Color tab adds no color commands, and Cancel, or OK with nothing changed, records no undo step. A Color tab field with a value of the wrong kind is an error, and the dialog stays open. The tab is VectorCraft's own layout; File › Document Color Mode and Edit › Assign Profile… stay as they are. Tests in `dialogs/document_setup.rs`.
- **Assign Profile's three choices:** the Assign rows of Edit › Assign Profile… (the Separations panel's Color Settings section) offer Don't Color Manage This Document, the working space of the document's color mode (Working RGB or Working CMYK, with its name) and Profile with the other profiles of that kind, as [Assign or remove a color profile](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=150) lists them. They act on the profile of the document's color mode: an RGB document's RGB profile, a CMYK document's CMYK profile; the other model's profile stays as it is (VectorCraft's own rule; Document Setup › Color sets both). Picking the working space assigns its profile, which stays when the working space changes later. A choice the document already has runs nothing. Tests in `panels/separations.rs`.
- **Canvas through the display's profile on Windows and X11:** Preferences › Performance › Use Monitor Profile for Canvas (on by default) converts the canvas's art, artboard paper and transparency grid from sRGB into the ICC profile of the display that shows most of the main window, after any proof, as the help page describes the monitor's profile translating the document's colors for the monitor ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=151)). Windows gives the display's default profile, and a display with Advanced Color on is left to Windows ([Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/wcs/advanced-color-icc-profiles)); X11 gives colord's profile for the output or the `_ICC_PROFILE` property. macOS converts the window itself, and a Wayland session stays sRGB. `ui.inspect` reports `displayProfile`. Tests in `color/src/cms/display.rs`, `ui-egui/src/display_profile.rs` and `canvas::tests::the_canvas_is_drawn_through_the_display_profile_while_the_preference_is_on`.
- **Translucent art blended before the display profile:** with Use Monitor Profile for Canvas converting, translucent art and the anti-aliased edges of art over an artboard's paper, a colored artboard or the transparency grid are blended with it in sRGB and the blend is converted, so the monitor's profile translates the document's colors as they are composited ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=151)). The frame rendered whole, the part an edit renders again, the render worker's frame, the pan fill and the other windows' panes do the same; over the pasteboard and in Outline the art is converted on its own, and with no profile to convert into nothing changes. Tests `display_profile::tests::translucent_pixels_over_the_paper_are_blended_before_they_are_converted`, `the_transparency_grid_is_blended_cell_by_cell`, `the_backdrop_is_found_through_the_view` and `canvas::tests::translucent_art_over_the_paper_is_blended_before_the_display_profile`.
- **Out-of-gamut warning after a profile change:** the out-of-gamut warning and its closest-color correction in the Color panel and Color Picker ([the help page](https://helpx.adobe.com/illustrator/using/adjusting-colors.html)) check the color against the document's assigned CMYK profile, else the working CMYK space, and update when Edit › Assign Profile… or Edit › Color Settings… changes that space or a loaded profile changes, without a change of color. Which CMYK space the warning uses is VectorCraft's own rule. Tests: `gamut_warning_follows_a_profile_change` and `gamut_warning_follows_a_profile_loaded_again` in `dialogs/color_picker/tests.rs`.