AccentColorConverter
struct · ferroui-controls-color-picker · v0.5.0
struct AccentColorConverter
Creates an accent color for a given base color value and step parameter.
This is a highly-specialized converter for the color picker.
Members
VALUE_DELTA
const VALUE_DELTA: f64
The amount to change the Value component for each accent color step.
new
fn new() -> Self
Initializes a new instance of the AccentColorConverter class.
get_accent
fn get_accent(hsv_color: HsvColor, accent_step: i32) -> HsvColor
This does not account for perceptual differences and also does not match with system accent color calculation.
Use the HSV representation as it's more perceptual. In most cases only the value is changed by a fixed percentage so the algorithm is reproducible.
hsv_color is the base color to calculate the accent from; accent_step
is the number of accent color steps to move (positive or negative).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyAnyValueClassDefaultsErasedDestructorIntoEitherDebugDefaultIValueConverterPartialEqMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.