use crate::values::computed::color::Color;
use crate::values::computed::url::ComputedUrl;
use crate::values::computed::{LengthPercentage, NonNegativeLengthPercentage, Opacity};
use crate::values::generics::svg as generic;
use crate::Zero;
pub use crate::values::specified::{DProperty, MozContextProperties, SVGPaintOrder, VectorEffect};
pub type SVGPaint = generic::GenericSVGPaint<Color, ComputedUrl>;
pub type SVGPaintKind = generic::GenericSVGPaintKind<Color, ComputedUrl>;
impl SVGPaint {
pub const BLACK: Self = Self {
kind: generic::SVGPaintKind::Color(Color::BLACK),
fallback: generic::SVGPaintFallback::Unset,
};
}
pub type SVGLength = generic::GenericSVGLength<LengthPercentage>;
impl SVGLength {
pub fn zero() -> Self {
generic::SVGLength::LengthPercentage(LengthPercentage::zero())
}
}
pub type SVGWidth = generic::GenericSVGLength<NonNegativeLengthPercentage>;
impl SVGWidth {
pub fn one() -> Self {
use crate::values::generics::NonNegative;
generic::SVGLength::LengthPercentage(NonNegative(LengthPercentage::one()))
}
}
pub type SVGStrokeDashArray = generic::GenericSVGStrokeDashArray<NonNegativeLengthPercentage>;
impl Default for SVGStrokeDashArray {
fn default() -> Self {
generic::SVGStrokeDashArray::Values(Default::default())
}
}
pub type SVGOpacity = generic::GenericSVGOpacity<Opacity>;
impl Default for SVGOpacity {
fn default() -> Self {
generic::SVGOpacity::Opacity(1.)
}
}