From 68c2c30f7d6a789e0b3dd72052908e052d8fafa3 Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 30 Nov 2026 03:20:40 +0100 Subject: [PATCH] Fill: test that a two-ink Duotone greys the same modes (#17477) Measured in the reference application: a Duotone with two inks refuses Darker Color, Lighter Color, Hue, Saturation, Color and Luminosity like a Monotone one. Co-Authored-By: Claude Opus 5.5 --- .../fill_cmds/duotone_multichannel_modes_tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/engine-paint/src/cmd/fill_cmds/duotone_multichannel_modes_tests.rs b/crates/engine-paint/src/cmd/fill_cmds/duotone_multichannel_modes_tests.rs index 88954cf47c..f9cdbda70b 100644 --- a/crates/engine-paint/src/cmd/fill_cmds/duotone_multichannel_modes_tests.rs +++ b/crates/engine-paint/src/cmd/fill_cmds/duotone_multichannel_modes_tests.rs @@ -61,3 +61,15 @@ fn sixteen_bit_duotone_and_multichannel_keep_every_mode() { assert!(greyed_modes(mode, SampleType::U16).is_empty(), "{mode:?}"); } } + +/// Measured too: a Duotone with two inks greys and refuses the same modes as a Monotone one. +#[test] +fn a_duotone_with_two_inks_greys_the_same_list() { + let mut s = crate::session(); + s.execute("file.new", json!({"width": 16, "height": 12, "mode": "grayscale", "depth": 8, "background": "white"})).unwrap(); + s.execute("image.mode.duotone", json!({"type": "duotone"})).unwrap(); + assert_eq!(s.active().unwrap().doc.mode, ColorMode::Duotone); + s.execute("select.all", json!({})).unwrap(); + assert!(s.execute("edit.fill", json!({"contents": "color", "color": "#336699", "mode": "hue"})).is_err(), "Hue"); + s.execute("edit.fill", json!({"contents": "color", "color": "#336699", "mode": "multiply"})).unwrap(); +}