pub struct ColorPicker {Show 24 fields
pub color: Color,
pub color_changed: ColorPickerColorChangedHandler,
pub previous_color: Option<Color>,
pub is_alpha_enabled: bool,
pub is_color_spectrum_visible: bool,
pub is_color_preview_visible: bool,
pub is_color_slider_visible: bool,
pub is_alpha_slider_visible: bool,
pub is_more_button_visible: bool,
pub is_color_channel_text_input_visible: bool,
pub is_alpha_text_input_visible: bool,
pub is_hex_input_visible: bool,
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 color_spectrum_shape: ColorSpectrumShape,
pub color_spectrum_components: ColorSpectrumComponents,
pub orientation: Axis,
pub corner_radius: Option<f64>,
pub is_enabled: bool,
pub key: Option<KeyRef>,
}Expand description
XAML ColorPicker with the template of ColorPicker.xaml.
Fields§
§color: ColorColor: white by default.
color_changed: ColorPickerColorChangedHandlerColorChanged: asks the application for another colour; the application owns color.
previous_color: Option<Color>PreviousColor: shown beside the colour while set.
is_alpha_enabled: boolIsAlphaEnabled: whether opacity can be chosen.
is_color_spectrum_visible: boolIsColorSpectrumVisible; true by default.
is_color_preview_visible: boolIsColorPreviewVisible; true by default.
is_color_slider_visible: boolIsColorSliderVisible: the third component’s slider; true by default.
is_alpha_slider_visible: boolIsAlphaSliderVisible, while alpha is enabled; true by default.
IsMoreButtonVisible: the text entries hide behind a More button, in the vertical
orientation only.
is_color_channel_text_input_visible: boolIsColorChannelTextInputVisible; true by default.
is_alpha_text_input_visible: boolIsAlphaTextInputVisible, while alpha is enabled; true by default.
is_hex_input_visible: boolIsHexInputVisible; true by default.
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.
color_spectrum_shape: ColorSpectrumShapeColorSpectrumShape.
color_spectrum_components: ColorSpectrumComponentsColorSpectrumComponents.
orientation: AxisOrientation: Axis::Vertical by default, or Axis::Horizontal.
corner_radius: Option<f64>CornerRadius of the spectrum, the preview and the opacity slider’s background;
ControlCornerRadius by default; the theme’s ControlCornerRadius when None.
is_enabled: boolIsEnabled.
key: Option<KeyRef>Identity retained across parent rebuilds.
Implementations§
Source§impl ColorPicker
impl ColorPicker
Sourcepub fn new(
color: Color,
color_changed: impl Fn(&mut App, ColorChangedEventArgs) + 'static,
) -> ColorPicker
pub fn new( color: Color, color_changed: impl Fn(&mut App, ColorChangedEventArgs) + 'static, ) -> ColorPicker
Creates a picker showing color, which asks for others through color_changed.
Sourcepub fn previous_color(self, value: Color) -> Self
pub fn previous_color(self, value: Color) -> Self
Sets PreviousColor.
Sourcepub fn is_alpha_enabled(self, value: bool) -> Self
pub fn is_alpha_enabled(self, value: bool) -> Self
Sets IsAlphaEnabled.
Sourcepub fn is_color_spectrum_visible(self, value: bool) -> Self
pub fn is_color_spectrum_visible(self, value: bool) -> Self
Sets IsColorSpectrumVisible.
Sourcepub fn is_color_preview_visible(self, value: bool) -> Self
pub fn is_color_preview_visible(self, value: bool) -> Self
Sets IsColorPreviewVisible.
Sourcepub fn is_color_slider_visible(self, value: bool) -> Self
pub fn is_color_slider_visible(self, value: bool) -> Self
Sets IsColorSliderVisible.
Sourcepub fn is_alpha_slider_visible(self, value: bool) -> Self
pub fn is_alpha_slider_visible(self, value: bool) -> Self
Sets IsAlphaSliderVisible.
Sets IsMoreButtonVisible.
Sourcepub fn is_color_channel_text_input_visible(self, value: bool) -> Self
pub fn is_color_channel_text_input_visible(self, value: bool) -> Self
Sets IsColorChannelTextInputVisible.
Sourcepub fn is_alpha_text_input_visible(self, value: bool) -> Self
pub fn is_alpha_text_input_visible(self, value: bool) -> Self
Sets IsAlphaTextInputVisible.
Sourcepub fn is_hex_input_visible(self, value: bool) -> Self
pub fn is_hex_input_visible(self, value: bool) -> Self
Sets IsHexInputVisible.
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 color_spectrum_shape(self, value: ColorSpectrumShape) -> Self
pub fn color_spectrum_shape(self, value: ColorSpectrumShape) -> Self
Sets ColorSpectrumShape.
Sourcepub fn color_spectrum_components(self, value: ColorSpectrumComponents) -> Self
pub fn color_spectrum_components(self, value: ColorSpectrumComponents) -> Self
Sets ColorSpectrumComponents.
Sourcepub fn orientation(self, value: Axis) -> Self
pub fn orientation(self, value: Axis) -> Self
Sets Orientation: Axis::Vertical by default, or Axis::Horizontal.
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 ColorPicker
impl Clone for ColorPicker
Source§impl Debug for ColorPicker
impl Debug for ColorPicker
Source§impl StatefulWidget for ColorPicker
impl StatefulWidget for ColorPicker
Source§type State = ColorPickerState
type State = ColorPickerState
Source§fn create_state(&self) -> ColorPickerState
fn create_state(&self) -> ColorPickerState
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 ColorPicker
impl !Send for ColorPicker
impl !Sync for ColorPicker
impl !UnwindSafe for ColorPicker
impl Forget for ColorPicker
impl Freeze for ColorPickerwhere
*const RcInner<dyn Fn(&mut App, ColorChangedEventArgs)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, ColorChangedEventArgs)>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for ColorPicker
impl Unpin for ColorPicker
impl UnsafeUnpin for ColorPickerwhere
*const RcInner<dyn Fn(&mut App, ColorChangedEventArgs)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, ColorChangedEventArgs)>>: 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.