use bevy::{ecs::component::Component, render::color::Color};
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: Color) -> Self {
Self {
options: FillOptions::default(),
color,
}
}
}
#[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: Color, line_width: f32) -> Self {
Self {
options: StrokeOptions::default().with_line_width(line_width),
color,
}
}
#[must_use]
pub fn color(color: Color) -> Self {
Self {
options: StrokeOptions::default(),
color,
}
}
}