From 9152904af1630a6d373b2fd7c284835bf0a3ca95 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 16 Mar 2024 20:13:44 +0100 Subject: Improve styling of `clock` example --- examples/clock/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/clock/src/main.rs') diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index e3f3fa34..953ecf6f 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -61,7 +61,7 @@ impl Clock { } fn theme(&self) -> Theme { - Theme::ALL[(self.now.unix_timestamp() as usize / 60) % Theme::ALL.len()] + Theme::ALL[(self.now.unix_timestamp() as usize / 10) % Theme::ALL.len()] .clone() } } @@ -94,7 +94,7 @@ impl canvas::Program for Clock { let radius = frame.width().min(frame.height()) / 2.0; let background = Path::circle(center, radius); - frame.fill(&background, palette.primary.weak.color); + frame.fill(&background, palette.secondary.strong.color); let short_hand = Path::line(Point::ORIGIN, Point::new(0.0, -0.5 * radius)); @@ -107,7 +107,7 @@ impl canvas::Program for Clock { let thin_stroke = || -> Stroke { Stroke { width, - style: stroke::Style::Solid(palette.primary.weak.text), + style: stroke::Style::Solid(palette.secondary.strong.text), line_cap: LineCap::Round, ..Stroke::default() } @@ -116,7 +116,7 @@ impl canvas::Program for Clock { let wide_stroke = || -> Stroke { Stroke { width: width * 3.0, - style: stroke::Style::Solid(palette.primary.weak.text), + style: stroke::Style::Solid(palette.secondary.strong.text), line_cap: LineCap::Round, ..Stroke::default() } @@ -150,7 +150,7 @@ impl canvas::Program for Clock { (0.78 * radius) * rotate_factor, -width * 2.0, ), - color: palette.primary.weak.text, + color: palette.secondary.strong.text, horizontal_alignment: if rotate_factor > 0.0 { alignment::Horizontal::Right } else { -- cgit