[][src]Macro embedded_graphics::egcircle

macro_rules! egcircle {
    (($cx:expr, $cy:expr), $r:expr $(, $style_key:ident = $style_value:expr )* $(,)?) => { ... };
}

Create a Circle with optional styling using a convenient macro.

use embedded_graphics::{egcircle, style::Style, primitives::Circle};

let line_circle: Circle<u8> = egcircle!((10, 20), 30);
let filled_circle: Circle<u8> = egcircle!((10, 20), 30, stroke = Some(5u8), fill = Some(10u8));
let default_style: Circle<u8> = egcircle!((10, 20), 30, style = Style::default());

Style properties like stroke map to the method calls on the WithStyle trait. For example, the following code makes two identical circles:

use embedded_graphics::prelude::*;
use embedded_graphics::{egcircle, style::Style, primitives::Circle};

let circle: Circle<u8> = egcircle!((10, 20), 30, stroke = Some(5u8), fill = Some(10u8));
let circle: Circle<u8> = Circle::new(Coord::new(10, 20), 30).stroke(Some(5u8)).fill(Some(10u8));