ColorSpectrum
struct · ferroui-controls-color-picker · v0.5.0
struct ColorSpectrum
A two dimensional spectrum for color selection.
Members
TYPEto_refPC_PRESSEDPC_DARK_SELECTORPC_LARGE_SELECTORPC_LIGHT_SELECTORTEMPLATE_PARTSPSEUDO_CLASSESconstructnewcolor_changedraise_color_changedcolor_propertycomponents_propertyhsv_color_propertymax_hue_propertymax_saturation_propertymax_value_propertymin_hue_propertymin_saturation_propertymin_value_propertyshape_propertythird_component_propertycolorset_colorcomponentsset_componentshsv_colorset_hsv_colormax_hueset_max_huemax_saturationset_max_saturationmax_valueset_max_valuemin_hueset_min_huemin_saturationset_min_saturationmin_valueset_min_valueshapeset_shapethird_component
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ColorSpectrum>
Returns a strong reference to this object.
PC_PRESSED
const PC_PRESSED: &'static str
The pseudo-class of a pressed spectrum.
PC_DARK_SELECTOR
const PC_DARK_SELECTOR: &'static str
The pseudo-class of a dark selection ellipse.
PC_LARGE_SELECTOR
const PC_LARGE_SELECTOR: &'static str
The pseudo-class of a large selection ellipse.
PC_LIGHT_SELECTOR
const PC_LIGHT_SELECTOR: &'static str
The pseudo-class of a light selection ellipse.
TEMPLATE_PARTS
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
The named parts expected in the control template.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudo-classes set by the class.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the ColorSpectrum class.
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.
raise_color_changed
fn raise_color_changed(self: &Self)
Raises the color changed event when the color differs from the last one reported.
color_property
fn color_property() -> &'static StyledProperty<Color>
Defines the Color property.
components_property
fn components_property() -> &'static StyledProperty<ColorSpectrumComponents>
Defines the Components property.
hsv_color_property
fn hsv_color_property() -> &'static StyledProperty<HsvColor>
Defines the HsvColor property.
max_hue_property
fn max_hue_property() -> &'static StyledProperty<i32>
Defines the MaxHue property.
max_saturation_property
fn max_saturation_property() -> &'static StyledProperty<i32>
Defines the MaxSaturation property.
max_value_property
fn max_value_property() -> &'static StyledProperty<i32>
Defines the MaxValue property.
min_hue_property
fn min_hue_property() -> &'static StyledProperty<i32>
Defines the MinHue property.
min_saturation_property
fn min_saturation_property() -> &'static StyledProperty<i32>
Defines the MinSaturation property.
min_value_property
fn min_value_property() -> &'static StyledProperty<i32>
Defines the MinValue property.
shape_property
fn shape_property() -> &'static StyledProperty<ColorSpectrumShape>
Defines the Shape property.
third_component_property
fn third_component_property() -> &'static DirectProperty<ColorSpectrum, ColorComponent>
Defines the ThirdComponent property.
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.
set_color
fn set_color(self: &Self, value: Color)
Sets color.
components
fn components(self: &Self) -> ColorSpectrumComponents
Gets the two HSV color components displayed by the spectrum.
Internally, the ColorSpectrum uses the HSV color model.
set_components
fn set_components(self: &Self, value: ColorSpectrumComponents)
Sets components.
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.
set_hsv_color
fn set_hsv_color(self: &Self, value: HsvColor)
Sets hsv_color.
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.
set_max_hue
fn set_max_hue(self: &Self, value: i32)
Sets max_hue.
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.
set_max_saturation
fn set_max_saturation(self: &Self, value: i32)
Sets max_saturation.
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.
set_max_value
fn set_max_value(self: &Self, value: i32)
Sets max_value.
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.
set_min_hue
fn set_min_hue(self: &Self, value: i32)
Sets min_hue.
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.
set_min_saturation
fn set_min_saturation(self: &Self, value: i32)
Sets min_saturation.
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.
set_min_value
fn set_min_value(self: &Self, value: i32)
Sets min_value.
shape
fn shape(self: &Self) -> ColorSpectrumShape
Gets the displayed shape of the spectrum.
set_shape
fn set_shape(self: &Self, value: ColorSpectrumShape)
Sets shape.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherTemplatedControlImplExtControlImplExtDerefUpcast<T>Upcast<ColorSpectrum>StaticTypeObjectTypeSubclassable<T>StyledElementImplLayoutableImplInteractiveImplDefaultConstructibleFerroObjectImplVisualImplControlImplTemplatedControlImplInputElementImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.