mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 02:18:11 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user