fix(render): an ICCBased CMYK colour is not taken as process tints; fix a patch number

Review of #3777. `Color::ink_tints` no longer gives tints for a
four-component ICCBased colour. Such a colour keeps its own profile, so a
group that holds one is drawn as before. vendor/README.md: the hayro
patch (21) entry refers to hayro-interpret patch (45), not (44).
This commit is contained in:
jpeskov
2026-10-28 18:20:28 -04:00
committed by KenM76
parent ba09e1aefc
commit 7f9530daf9
2 changed files with 5 additions and 8 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+3 -6
View File
@@ -1403,9 +1403,9 @@ impl Color {
/// its opacity, for blending in a `DeviceCMYK` transparency group (ISO 32000-2 §11.3.4).
///
/// `DeviceCMYK` gives its components. `DeviceGray` is black ink alone, `K = 1 − gray`
/// (§10.4.2.2). Four-component ICC colour is taken as the tints it names, unconverted.
/// `None` for every other space: such a colour has no tints without a colour conversion
/// this crate does not make, and the caller draws it as before.
/// (§10.4.2.2). `None` for every other space, ICCBased CMYK included: such a colour has no
/// tints without a colour conversion this crate does not make (an ICCBased colour keeps
/// its own profile), and the caller draws it as before.
pub fn ink_tints(&self) -> Option<([f32; 4], f32)> {
let c = |i: usize| {
self.components
@@ -1416,9 +1416,6 @@ impl Color {
};
let tints = match self.color_space.0.as_ref() {
ColorSpaceType::DeviceCmyk => [c(0), c(1), c(2), c(3)],
ColorSpaceType::ICCBased(icc) if icc.0.number_components == 4 => {
[c(0), c(1), c(2), c(3)]
}
ColorSpaceType::DeviceGray => [0.0, 0.0, 0.0, 1.0 - c(0)],
_ => return None,
};