/// Color by a per-point scalar attribute mapped through a colormap.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct SpatialAppearanceColoringGeometry {
    #[builder(into)]
    #[serde(rename = "attribute")]
    attribute: String,
    #[serde(rename = "colormap")]
    colormap: super::SpatialColorMap,
    #[builder(default, into)]
    #[serde(rename = "rangeMin", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    range_min: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "rangeMax", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    range_max: Option<f64>,
}
impl SpatialAppearanceColoringGeometry {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(attribute: impl Into<String>, colormap: super::SpatialColorMap) -> Self {
        Self::builder().attribute(attribute).colormap(colormap).build()
    }
    /// Name of the per-point attribute to ramp (e.g. "intensity").
    #[inline]
    pub fn attribute(&self) -> &str {
        &*self.attribute
    }
    #[inline]
    pub fn colormap(&self) -> &super::SpatialColorMap {
        &self.colormap
    }
    /// Colormap lower bound; omit to use the attribute's data minimum.
    #[inline]
    pub fn range_min(&self) -> Option<f64> {
        self.range_min.as_ref().map(|o| *o)
    }
    /// Colormap upper bound; omit to use the attribute's data maximum.
    #[inline]
    pub fn range_max(&self) -> Option<f64> {
        self.range_max.as_ref().map(|o| *o)
    }
}
