mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-17 15:44:44 +00:00
color: DrawingML colours come from craft-drawingml (craft-libs#778, #792)
deckcraft-color re-exports craft_drawingml::color (Rgba, SchemeSlot, ColorScheme, ColorTransform, presets and transforms) and its own copy is deleted. The existing colour tests run unchanged against the shared module. ColorScheme literals use ColorScheme::new, since the shared scheme also keeps extra colours and tint rows.
This commit is contained in:
1 parent
3b6f9e7cb8
commit
dea0af6ceb
7 files changed
+36
-761
No files matched your search
@@ -155,7 +155,7 @@ pub fn draw_layout_with(ctx: &mut RenderContext, l: &deckcraft_text::TextLayout,
|
||||
};
|
||||
let li = lines_of.line_at(run.para, *y);
|
||||
if !grads.iter().any(|(i, _)| *i == li) {
|
||||
let scheme = deckcraft_color::ColorScheme { name: String::new(), colors: [Rgba::BLACK; 12] };
|
||||
let scheme = deckcraft_color::ColorScheme::new(String::new(), [Rgba::BLACK; 12]);
|
||||
let stops = g.stops.iter().map(|s| (s.pos, s.color.resolve(&scheme, None))).collect();
|
||||
let bounds = l.lines.get(li).and_then(line_bounds).unwrap_or(tr);
|
||||
grads.push((li, paint::gradient(&g.shape, stops, bounds, run.alpha * ps.opacity)));
|
||||
|
||||
Reference in new issue
Block a user