pub struct ColorWheel<'a> { /* private fields */ }Expand description
A colour wheel, with its luminance slider.
Need (image): a colour wheel. Need (input): a colour picked on a wheel.
Implementations§
Source§impl<'a> ColorWheel<'a>
impl<'a> ColorWheel<'a>
Sourcepub fn offset(value: &'a mut WheelValue, label: &str) -> ColorWheel<'a>
pub fn offset(value: &'a mut WheelValue, label: &str) -> ColorWheel<'a>
A grading wheel (lift, gamma, gain): neutral at the centre, relative drags, a signed luminance from -1 to 1.
Sourcepub fn picker(value: &'a mut WheelValue, label: &str) -> ColorWheel<'a>
pub fn picker(value: &'a mut WheelValue, label: &str) -> ColorWheel<'a>
A hue and saturation picker: a press picks, a luminance from 0 to 1.
Sourcepub fn default(self, default: WheelValue) -> Self
pub fn default(self, default: WheelValue) -> Self
What a double click goes back to (zero; a picker’s luminance at a half).
Sourcepub fn size(self, size: f32) -> Self
pub fn size(self, size: f32) -> Self
The disc’s diameter in points (160 by default); the slider is as wide.
Sourcepub fn luminance(self, range: Option<RangeInclusive<f64>>) -> Self
pub fn luminance(self, range: Option<RangeInclusive<f64>>) -> Self
The luminance slider’s range, or no slider (None).
Sourcepub fn step(self, step: f32) -> Self
pub fn step(self, step: f32) -> Self
How far an arrow key moves the puck, in radii (a hundredth by default).
Sourcepub fn on_change(
self,
hook: impl FnMut(&Change<WheelValue>) -> Verdict<WheelValue> + 'a,
) -> Self
pub fn on_change( self, hook: impl FnMut(&Change<WheelValue>) -> Verdict<WheelValue> + 'a, ) -> Self
Sees each change before it is written: allow, veto or redirect (another value; for a change of the luminance, its luminance is taken).
Sourcepub fn show(self, ui: &mut Ui) -> WheelOutput
pub fn show(self, ui: &mut Ui) -> WheelOutput
Draws the wheel and its slider; says what changed.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ColorWheel<'a>
impl<'a> !RefUnwindSafe for ColorWheel<'a>
impl<'a> !Send for ColorWheel<'a>
impl<'a> !Sync for ColorWheel<'a>
impl<'a> Unpin for ColorWheel<'a>
impl<'a> UnsafeUnpin for ColorWheel<'a>
impl<'a> !UnwindSafe for ColorWheel<'a>
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.