FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ColorSpectrum

    struct · ferroui-controls-color-picker · v0.5.0

    struct ColorSpectrum
    

    A two dimensional spectrum for color selection.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ColorSpectrum>
    

    Returns a strong reference to this object.

    Source

    PC_PRESSED

    const PC_PRESSED: &'static str
    

    The pseudo-class of a pressed spectrum.

    Source

    PC_DARK_SELECTOR

    const PC_DARK_SELECTOR: &'static str
    

    The pseudo-class of a dark selection ellipse.

    Source

    PC_LARGE_SELECTOR

    const PC_LARGE_SELECTOR: &'static str
    

    The pseudo-class of a large selection ellipse.

    Source

    PC_LIGHT_SELECTOR

    const PC_LIGHT_SELECTOR: &'static str
    

    The pseudo-class of a light selection ellipse.

    Source

    TEMPLATE_PARTS

    const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
    

    The named parts expected in the control template.

    Source

    PSEUDO_CLASSES

    const PSEUDO_CLASSES: PseudoClassesAttribute
    

    The pseudo-classes set by the class.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the ColorSpectrum class.

    Source

    color_changed

    fn color_changed(self: &Self, handler: impl Fn(&ColorChangedEventArgs) -> () + 'static) -> Rc<dyn IDisposable>
    

    Event for when the selected color changes within the spectrum. Disposing the returned handle unsubscribes.

    Source

    raise_color_changed

    fn raise_color_changed(self: &Self)
    

    Raises the color changed event when the color differs from the last one reported.

    Source

    color_property

    fn color_property() -> &'static StyledProperty<Color>
    

    Defines the Color property.

    Source

    components_property

    fn components_property() -> &'static StyledProperty<ColorSpectrumComponents>
    

    Defines the Components property.

    Source

    hsv_color_property

    fn hsv_color_property() -> &'static StyledProperty<HsvColor>
    

    Defines the HsvColor property.

    Source

    max_hue_property

    fn max_hue_property() -> &'static StyledProperty<i32>
    

    Defines the MaxHue property.

    Source

    max_saturation_property

    fn max_saturation_property() -> &'static StyledProperty<i32>
    

    Defines the MaxSaturation property.

    Source

    max_value_property

    fn max_value_property() -> &'static StyledProperty<i32>
    

    Defines the MaxValue property.

    Source

    min_hue_property

    fn min_hue_property() -> &'static StyledProperty<i32>
    

    Defines the MinHue property.

    Source

    min_saturation_property

    fn min_saturation_property() -> &'static StyledProperty<i32>
    

    Defines the MinSaturation property.

    Source

    min_value_property

    fn min_value_property() -> &'static StyledProperty<i32>
    

    Defines the MinValue property.

    Source

    shape_property

    fn shape_property() -> &'static StyledProperty<ColorSpectrumShape>
    

    Defines the Shape property.

    Source

    third_component_property

    fn third_component_property() -> &'static DirectProperty<ColorSpectrum, ColorComponent>
    

    Defines the ThirdComponent property.

    Source

    color

    fn color(self: &Self) -> Color
    

    Gets the currently selected color in the RGB color model.

    For control authors, use hsv_color instead to avoid loss of precision and color drifting.

    Source

    set_color

    fn set_color(self: &Self, value: Color)
    

    Sets color.

    Source

    components

    fn components(self: &Self) -> ColorSpectrumComponents
    

    Gets the two HSV color components displayed by the spectrum.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_components

    fn set_components(self: &Self, value: ColorSpectrumComponents)
    

    Sets components.

    Source

    hsv_color

    fn hsv_color(self: &Self) -> HsvColor
    

    Gets the currently selected color in the HSV color model.

    This should be used in all cases instead of the color property. Internally, the ColorSpectrum uses the HSV color model and using this property will avoid loss of precision and color drifting.

    Source

    set_hsv_color

    fn set_hsv_color(self: &Self, value: HsvColor)
    

    Sets hsv_color.

    Source

    max_hue

    fn max_hue(self: &Self) -> i32
    

    Gets the maximum value of the Hue component in the range from 0..359. This property must be greater than min_hue.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_max_hue

    fn set_max_hue(self: &Self, value: i32)
    

    Sets max_hue.

    Source

    max_saturation

    fn max_saturation(self: &Self) -> i32
    

    Gets the maximum value of the Saturation component in the range from 0..100. This property must be greater than min_saturation.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_max_saturation

    fn set_max_saturation(self: &Self, value: i32)
    

    Sets max_saturation.

    Source

    max_value

    fn max_value(self: &Self) -> i32
    

    Gets the maximum value of the Value component in the range from 0..100. This property must be greater than min_value.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_max_value

    fn set_max_value(self: &Self, value: i32)
    

    Sets max_value.

    Source

    min_hue

    fn min_hue(self: &Self) -> i32
    

    Gets the minimum value of the Hue component in the range from 0..359. This property must be less than max_hue.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_min_hue

    fn set_min_hue(self: &Self, value: i32)
    

    Sets min_hue.

    Source

    min_saturation

    fn min_saturation(self: &Self) -> i32
    

    Gets the minimum value of the Saturation component in the range from 0..100. This property must be less than max_saturation.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_min_saturation

    fn set_min_saturation(self: &Self, value: i32)
    

    Sets min_saturation.

    Source

    min_value

    fn min_value(self: &Self) -> i32
    

    Gets the minimum value of the Value component in the range from 0..100. This property must be less than max_value.

    Internally, the ColorSpectrum uses the HSV color model.

    Source

    set_min_value

    fn set_min_value(self: &Self, value: i32)
    

    Sets min_value.

    Source

    shape

    fn shape(self: &Self) -> ColorSpectrumShape
    

    Gets the displayed shape of the spectrum.

    Source

    set_shape

    fn set_shape(self: &Self, value: ColorSpectrumShape)
    

    Sets shape.

    Source

    third_component

    fn third_component(self: &Self) -> ColorComponent
    

    Gets the third HSV color component that is NOT displayed by the spectrum. This is automatically calculated from the components property.

    This property should be used for any external color slider that represents the third component of the color. Note that this property uses the generic ColorComponent type instead of the more accurate HsvComponent to allow direct usage by the generalized color sliders.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.