From 3a26a8ccd4c406b4b3f0d5c6d2863d0613798f01 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 10 Jul 2022 15:23:51 +0200 Subject: Use `Palette` consistently in `arc` example --- examples/pure/arc/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'examples/pure') diff --git a/examples/pure/arc/src/main.rs b/examples/pure/arc/src/main.rs index 38b3f502..df0e1e8a 100644 --- a/examples/pure/arc/src/main.rs +++ b/examples/pure/arc/src/main.rs @@ -5,9 +5,7 @@ use iced::pure::widget::canvas::{ self, Cache, Canvas, Cursor, Geometry, Path, Stroke, }; use iced::pure::{Application, Element}; -use iced::{ - Color, Command, Length, Point, Rectangle, Settings, Subscription, Theme, -}; +use iced::{Command, Length, Point, Rectangle, Settings, Subscription, Theme}; pub fn main() -> iced::Result { Arc::run(Settings { @@ -80,6 +78,8 @@ impl canvas::Program for Arc { _cursor: Cursor, ) -> Vec { let geometry = self.cache.draw(bounds.size(), |frame| { + let palette = theme.palette(); + let center = frame.center(); let radius = frame.width().min(frame.height()) / 5.0; @@ -101,7 +101,7 @@ impl canvas::Program for Arc { b.circle(end, 10.0); }); - frame.fill(&circles, Color::WHITE); + frame.fill(&circles, palette.text); let path = Path::new(|b| { b.move_to(start); @@ -109,8 +109,6 @@ impl canvas::Program for Arc { b.line_to(end); }); - let palette = theme.palette(); - frame.stroke( &path, Stroke { -- cgit