mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-29 20:47:32 -06:00
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:
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+3
-6
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user