use bevy::{color::Color, ecs::component::Component};
use lyon_tessellation::{FillOptions, StrokeOptions};
#[allow(missing_docs)]
#[derive(Component, Debug, Clone, Copy, PartialEq)]
pub struct Fill {
pub options: FillOptions,
pub color: Color,
}
impl Fill {
#[must_use]
pub fn color(color: impl Into<Color>) -> Self {
Self {
options: FillOptions::default(),
color: color.into(),
}
}
}
#[allow(missing_docs)]
#[derive(Component, Debug, Clone, Copy, PartialEq)]
pub struct Stroke {
pub options: StrokeOptions,
pub color: Color,
}
impl Stroke {
#[must_use]
pub fn new(color: impl Into<Color>, line_width: f32) -> Self {
Self {
options: StrokeOptions::default().with_line_width(line_width),
color: color.into(),
}
}
#[must_use]
pub fn color(color: impl Into<Color>) -> Self {
Self {
options: StrokeOptions::default(),
color: color.into(),
}
}
}