Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs (#4149)

* Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs

* Code review fixes
This commit is contained in:
Keavon Chambers
2026-05-14 22:48:33 -07:00
committed by GitHub
parent 456a7c868d
commit a56746c6bf
67 changed files with 1210 additions and 941 deletions
@@ -1,10 +1,22 @@
use core_types::BlendMode;
use core_types::color::SRGBA8;
use vello::peniko;
pub trait BlendModeExt {
fn to_peniko(&self) -> peniko::Mix;
}
pub trait ToPenikoColor {
fn to_peniko_color(&self) -> peniko::Color;
}
impl ToPenikoColor for SRGBA8 {
#[inline(always)]
fn to_peniko_color(&self) -> peniko::Color {
peniko::Color::from_rgba8(self.red, self.green, self.blue, self.alpha)
}
}
impl BlendModeExt for BlendMode {
fn to_peniko(&self) -> peniko::Mix {
match self {