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 <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-11-30 03:20:40 +01:00
1 parent 4e028bc29a
commit 68c2c30f7d
1 file changed
+12
@@ -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();
}