summaryrefslogtreecommitdiffstats
path: root/examples/clock
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 20:13:44 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-16 20:13:44 +0100
commit9152904af1630a6d373b2fd7c284835bf0a3ca95 (patch)
tree9b670c2c2ebba6a2038bf67df76a1c1ffd87fcd6 /examples/clock
parent9d79d7b96bb133820a097a6503a9003075ef714a (diff)
downloadiced-9152904af1630a6d373b2fd7c284835bf0a3ca95.tar.gz
iced-9152904af1630a6d373b2fd7c284835bf0a3ca95.tar.bz2
iced-9152904af1630a6d373b2fd7c284835bf0a3ca95.zip
Improve styling of `clock` example
Diffstat (limited to 'examples/clock')
-rw-r--r--examples/clock/src/main.rs10
1 files changed, 5 insertions, 5 deletions
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<Message> canvas::Program<Message> 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<Message> canvas::Program<Message> 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<Message> canvas::Program<Message> 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<Message> canvas::Program<Message> 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 {