pub struct ClockFace {
pub hour_color: Color,
pub minute_color: Option<Color>,
pub hour_size: TickSize,
pub minute_size: TickSize,
}Expand description
Helper that constructs a standard set of TickMark layers (12 hour
marks and optionally 48 minute marks at non-hour positions) and pushes
them onto a Clock in z-order. Call this before pushing hand
layers so the hands paint on top of the face.
Sizes are deliberately conservative defaults; for custom faces
construct individual TickMarks and push them with
Clock::push_layer.
Fields§
§hour_color: ColorColor for hour marks (12 marks at cardinal positions).
minute_color: Option<Color>Color for minute marks; None disables them.
hour_size: TickSizeOuter radius / length / width of hour marks (fractions of radius).
minute_size: TickSizeOuter radius / length / width of minute marks.
Implementations§
Source§impl ClockFace
impl ClockFace
Sourcepub const fn standard(hour_color: Color, minute_color: Color) -> Self
pub const fn standard(hour_color: Color, minute_color: Color) -> Self
Standard 12-hour-mark + 48-minute-mark face.
Sourcepub const fn hours_only(color: Color) -> Self
pub const fn hours_only(color: Color) -> Self
12 hour marks, no minute marks.
Sourcepub fn push_layers(&self, clock: &mut Clock)
pub fn push_layers(&self, clock: &mut Clock)
Push tick layers onto clock in z-order: minute marks first (so
hour marks paint on top at cardinal positions if their bboxes
overlap).