diff options
| author | Martin Haug <mhaug@live.de> | 2022-02-08 21:12:09 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-02-08 21:12:09 +0100 |
| commit | fe70db1f4ce078f7b41c163a1c0ead31fd04850a (patch) | |
| tree | 0f85390a89a05dc763cbc2eb6c611c48877c08cd /src/export/render.rs | |
| parent | 62cf2a19d7207118f115c05c8f7c453d6db77a0a (diff) | |
New color stuff
- CMYK function
- More default colors
- Interpret RGB values as sRGB
Diffstat (limited to 'src/export/render.rs')
| -rw-r--r-- | src/export/render.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/export/render.rs b/src/export/render.rs index c41bcbf2..8b7aa46d 100644 --- a/src/export/render.rs +++ b/src/export/render.rs @@ -10,7 +10,7 @@ use usvg::FitTo; use crate::font::{Face, FaceId}; use crate::frame::{Element, Frame, Geometry, Group, Shape, Stroke, Text}; -use crate::geom::{self, Color, Length, Paint, PathElement, Size, Transform}; +use crate::geom::{self, Length, Paint, PathElement, Size, Transform}; use crate::image::{Image, RasterImage, Svg}; use crate::Context; @@ -279,7 +279,8 @@ fn render_outline_glyph( let bottom = top + mh; // Premultiply the text color. - let Paint::Solid(Color::Rgba(c)) = text.fill; + let Paint::Solid(color) = text.fill; + let c = color.to_rgba(); let color = sk::ColorU8::from_rgba(c.r, c.g, c.b, 255).premultiply().get(); // Blend the glyph bitmap with the existing pixels on the canvas. @@ -453,7 +454,8 @@ impl From<Transform> for sk::Transform { impl From<Paint> for sk::Paint<'static> { fn from(paint: Paint) -> Self { let mut sk_paint = sk::Paint::default(); - let Paint::Solid(Color::Rgba(c)) = paint; + let Paint::Solid(color) = paint; + let c = color.to_rgba(); sk_paint.set_color_rgba8(c.r, c.g, c.b, c.a); sk_paint.anti_alias = true; sk_paint |
