use csscolorparser::Color;

use super::WriteElement;

/// [feFlood](https://www.w3.org/TR/SVG11/filters.html#feFloodElement)
#[derive(Debug)]
pub struct Flood {
    pub flood_color: Color,
    pub flood_opacity: f32,
}

impl WriteElement for Flood {
    fn attrs(&self) -> Vec<quick_xml::events::attributes::Attribute> {
        gen_attrs![
            b"flood-color": self.flood_color.to_hex_string(),
            b"flood-opacity": self.flood_opacity
        ]
    }

    fn tag_name(&self) -> &'static str {
        "feFlood"
    }
}
