pub struct ColorSpectrum {Show 13 fields
pub hsv_color: HsvColor,
pub color_changed: ColorSpectrumColorChangedHandler,
pub min_hue: i32,
pub max_hue: i32,
pub min_saturation: i32,
pub max_saturation: i32,
pub min_value: i32,
pub max_value: i32,
pub shape: ColorSpectrumShape,
pub components: ColorSpectrumComponents,
pub corner_radius: f64,
pub is_enabled: bool,
pub key: Option<KeyRef>,
}Expand description
XAML ColorSpectrum with the template of ColorSpectrum.xaml.
Fields§
§hsv_color: HsvColorHsvColor: the selected colour; Color is HsvColor::to_color of it.
color_changed: ColorSpectrumColorChangedHandlerColorChanged: asks the application for another HsvColor; the application owns
hsv_color.
min_hue: i32MinHue, from 0 to 359; 0 by default.
max_hue: i32MaxHue, from 0 to 359; 359 by default.
min_saturation: i32MinSaturation, from 0 to 100; 0 by default.
max_saturation: i32MaxSaturation, from 0 to 100; 100 by default.
min_value: i32MinValue, from 0 to 100; 0 by default.
max_value: i32MaxValue, from 0 to 100; 100 by default.
shape: ColorSpectrumShapeShape.
components: ColorSpectrumComponentsComponents.
corner_radius: f64CornerRadius of the box: its top left is the rectangles’ RadiusX, its bottom right
their RadiusY, the same here; 0 by default, as the style sets none.
is_enabled: boolIsEnabled.
key: Option<KeyRef>Identity retained across parent rebuilds.
Implementations§
Source§impl ColorSpectrum
impl ColorSpectrum
Sourcepub fn new(
hsv_color: HsvColor,
color_changed: impl Fn(&mut App, ColorSpectrumColorChangedEventArgs) + 'static,
) -> ColorSpectrum
pub fn new( hsv_color: HsvColor, color_changed: impl Fn(&mut App, ColorSpectrumColorChangedEventArgs) + 'static, ) -> ColorSpectrum
Creates a spectrum selecting hsv_color, which asks for others through color_changed.
Sourcepub fn min_saturation(self, value: i32) -> Self
pub fn min_saturation(self, value: i32) -> Self
Sets MinSaturation.
Sourcepub fn max_saturation(self, value: i32) -> Self
pub fn max_saturation(self, value: i32) -> Self
Sets MaxSaturation.
Sourcepub fn shape(self, value: ColorSpectrumShape) -> Self
pub fn shape(self, value: ColorSpectrumShape) -> Self
Sets Shape.
Sourcepub fn components(self, value: ColorSpectrumComponents) -> Self
pub fn components(self, value: ColorSpectrumComponents) -> Self
Sets Components.
Sourcepub fn corner_radius(self, value: f64) -> Self
pub fn corner_radius(self, value: f64) -> Self
Sets CornerRadius.
Sourcepub fn is_enabled(self, value: bool) -> Self
pub fn is_enabled(self, value: bool) -> Self
Sets IsEnabled.
Trait Implementations§
Source§impl Clone for ColorSpectrum
impl Clone for ColorSpectrum
Source§impl Debug for ColorSpectrum
impl Debug for ColorSpectrum
Source§impl StatefulWidget for ColorSpectrum
impl StatefulWidget for ColorSpectrum
Source§type State = ColorSpectrumState
type State = ColorSpectrumState
Source§fn create_state(&self) -> ColorSpectrumState
fn create_state(&self) -> ColorSpectrumState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for ColorSpectrum
impl !Send for ColorSpectrum
impl !Sync for ColorSpectrum
impl !UnwindSafe for ColorSpectrum
impl Forget for ColorSpectrum
impl Freeze for ColorSpectrumwhere
*const RcInner<dyn Fn(&mut App, ColorSpectrumColorChangedEventArgs)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, ColorSpectrumColorChangedEventArgs)>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for ColorSpectrum
impl Unpin for ColorSpectrum
impl UnsafeUnpin for ColorSpectrumwhere
*const RcInner<dyn Fn(&mut App, ColorSpectrumColorChangedEventArgs)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, ColorSpectrumColorChangedEventArgs)>>: UnsafeUnpin,
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.