use super::{Color, Gradient};
use crate::types::DotType;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct DotsOptions {
pub dot_type: DotType,
pub color: Color,
pub gradient: Option<Gradient>,
pub round_size: bool,
}
impl Default for DotsOptions {
fn default() -> Self {
Self {
dot_type: DotType::Square,
color: Color::BLACK,
gradient: None,
round_size: true,
}
}
}
impl DotsOptions {
pub fn new(dot_type: DotType) -> Self {
Self {
dot_type,
..Default::default()
}
}
pub fn with_type(mut self, dot_type: DotType) -> Self {
self.dot_type = dot_type;
self
}
pub fn with_color(mut self, color: Color) -> Self {
self.color = color;
self
}
pub fn with_gradient(mut self, gradient: Gradient) -> Self {
self.gradient = Some(gradient);
self
}
pub fn with_round_size(mut self, round_size: bool) -> Self {
self.round_size = round_size;
self
}
}