mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 23:58:12 +08:00
Restructure node crates (#3384)
* Restructure node-graph folder * Fix wasm compilation * Move node definitions out of *-types crates * Cleanup * Fix warnings * Fix warnings * Start adding migrations * Add migrations and move memo nodes to gcore * Move nodes/gsvg-render -> rendering * Replace some hard coded identifiers and fix automatic conversion * Fix Vec2Value node migration * Fix formatting * Add more migrations * Cleanup features * Fix core_types::raster import * Update demo artwork (to make profile ci work) * Move *-types to node-graph/libraries folder * Add missing node migrations * Migrate more nodes * Remove impure memo node * More fixes and remove warning * Migrate context and add a few missing migrations --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
12453d2e61
commit
57b0b9c7ed
@@ -0,0 +1,36 @@
|
||||
use core_types::BlendMode;
|
||||
use vello::peniko;
|
||||
|
||||
pub trait BlendModeExt {
|
||||
fn to_peniko(&self) -> peniko::Mix;
|
||||
}
|
||||
|
||||
impl BlendModeExt for BlendMode {
|
||||
fn to_peniko(&self) -> peniko::Mix {
|
||||
match self {
|
||||
// Normal group
|
||||
BlendMode::Normal => peniko::Mix::Normal,
|
||||
// Darken group
|
||||
BlendMode::Darken => peniko::Mix::Darken,
|
||||
BlendMode::Multiply => peniko::Mix::Multiply,
|
||||
BlendMode::ColorBurn => peniko::Mix::ColorBurn,
|
||||
// Lighten group
|
||||
BlendMode::Lighten => peniko::Mix::Lighten,
|
||||
BlendMode::Screen => peniko::Mix::Screen,
|
||||
BlendMode::ColorDodge => peniko::Mix::ColorDodge,
|
||||
// Contrast group
|
||||
BlendMode::Overlay => peniko::Mix::Overlay,
|
||||
BlendMode::SoftLight => peniko::Mix::SoftLight,
|
||||
BlendMode::HardLight => peniko::Mix::HardLight,
|
||||
// Inversion group
|
||||
BlendMode::Difference => peniko::Mix::Difference,
|
||||
BlendMode::Exclusion => peniko::Mix::Exclusion,
|
||||
// Component group
|
||||
BlendMode::Hue => peniko::Mix::Hue,
|
||||
BlendMode::Saturation => peniko::Mix::Saturation,
|
||||
BlendMode::Color => peniko::Mix::Color,
|
||||
BlendMode::Luminosity => peniko::Mix::Luminosity,
|
||||
_ => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user