summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-10 15:23:51 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-10 15:23:51 +0200
commit3a26a8ccd4c406b4b3f0d5c6d2863d0613798f01 (patch)
treeb0139b1e87a7f98536c3d83cac1b99eafd0b28aa /examples
parent1454bcda4cf37f5d92c6034800eae2fc0aeb88ec (diff)
downloadiced-3a26a8ccd4c406b4b3f0d5c6d2863d0613798f01.tar.gz
iced-3a26a8ccd4c406b4b3f0d5c6d2863d0613798f01.tar.bz2
iced-3a26a8ccd4c406b4b3f0d5c6d2863d0613798f01.zip
Use `Palette` consistently in `arc` example
Diffstat (limited to 'examples')
-rw-r--r--examples/pure/arc/src/main.rs10
1 files changed, 4 insertions, 6 deletions
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<Message> canvas::Program<Message> for Arc {
_cursor: Cursor,
) -> Vec<Geometry> {
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<Message> canvas::Program<Message> 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<Message> canvas::Program<Message> for Arc {
b.line_to(end);
});
- let palette = theme.palette();
-
frame.stroke(
&path,
Stroke {