fn draw_seconds_hand(seconds: u32) -> impl Iterator<Item = Pixel<BinaryColor>> {
    // Convert seconds into a position around the circle in radians
    let seconds_radians = ((seconds as f32 / 60.0) * 2.0 * PI) + START;

    let end = polar(seconds_radians, SIZE as f32);

    // Basic line hand
    let hand = Line::new(CENTER, end).into_styled(PrimitiveStyle::with_stroke(BinaryColor::On, 1));

    // Decoration position
    let decoration_position = polar(seconds_radians, SIZE as f32 - 23.0);

    // Decoration style
    let decoration_style = PrimitiveStyleBuilder::new()
        .fill_color(BinaryColor::Off)
        .stroke_color(BinaryColor::On)
        .stroke_width(1)
        .build();

    // Add a fancy circle near the end of the hand
    let decoration = Circle::new(decoration_position, 3).into_styled(decoration_style);

    hand.pixels()
        .into_iter()
        .chain(decoration.pixels().into_iter())
}
/// Draw the seconds hand given a seconds value (0 - 59)
Draw the seconds hand given a seconds value (0 - 59)
Draw the seconds hand given a seconds value ( 0 - 59 )
fn draw_seconds_hand(seconds: u32) -> impl Iterator<Item = Pixel<BinaryColor>> {
    // Convert seconds into a position around the circle in radians
    let seconds_radians = ((seconds as f32 / 60.0) * 2.0 * PI) + START;
    let end = polar(seconds_radians, SIZE as f32);
    // Basic line hand
    let hand = Line::new(CENTER, end).into_styled(PrimitiveStyle::with_stroke(BinaryColor::On, 1));
    // Decoration position
    let decoration_position = polar(seconds_radians, SIZE as f32 - 23.0);
    // Decoration style
    let decoration_style = PrimitiveStyleBuilder::new()
        .fill_color(BinaryColor::Off)
        .stroke_color(BinaryColor::On)
        .stroke_width(1)
        .build();
    // Add a fancy circle near the end of the hand
    let decoration = Circle::new(decoration_position, 3).into_styled(decoration_style);
    hand.pixels()
        .into_iter()
        .chain(decoration.pixels().into_iter())
}
fn draw_seconds_hand ( seconds : u32 ) -> impl Iterator < Item = Pixel < BinaryColor > > { // Convert seconds into a position around the circle in radians let seconds_radians = ( ( seconds as f32 / 60.0 ) * 2.0 * PI ) + START ; let end = polar ( seconds_radians , SIZE as f32 ) ; // Basic line hand let hand = Line :: new ( CENTER , end ) . into_styled ( PrimitiveStyle :: with_stroke ( BinaryColor :: On , 1 ) ) ; // Decoration position let decoration_position = polar ( seconds_radians , SIZE as f32 - 23.0 ) ; // Decoration style let decoration_style = PrimitiveStyleBuilder :: new ( ) . fill_color ( BinaryColor :: Off ) . stroke_color ( BinaryColor :: On ) . stroke_width ( 1 ) . build ( ) ; // Add a fancy circle near the end of the hand let decoration = Circle :: new ( decoration_position , 3 ) . into_styled ( decoration_style ) ; hand . pixels ( ) . into_iter ( ) . chain ( decoration . pixels ( ) . into_iter ( ) ) }
Draw the seconds hand given a seconds value (0 - 59)
Draw the seconds hand given a seconds value ( 0 - 59 )
seconds
u32
seconds
u32