HSVColour class
A colour described by hue, saturation and value (brightness), usable anywhere a Flutter HSVColor is expected.
HSV is handy for colour pickers: hue picks the colour, saturation how vivid it is, and value how bright.
- Inheritance
-
- Object
- ColourSpace
- HSVColour
- Implemented types
- Available extensions
Constructors
- HSVColour({double alpha = 1.0, double hue = 360, double saturation = 1.0, double value = 1})
-
Creates an HSV colour. Defaults to opaque, fully saturated, full
brightness red.
const
- HSVColour.fromAHSV(double alpha, double hue, double saturation, double value)
-
Creates an HSV colour from opacity (0.0 to 1.0), hue (0 to 360),
saturation (0.0 to 1.0) and value (0.0 to 1.0), in that order.
const
- HSVColour.fromColor(Color color)
-
Converts a Flutter Color to HSV.
factory
- HSVColour.fromColour(Colour colour)
-
Converts a Colour to HSV.
factory
- HSVColour.fromHSLColour(HSLColour hsl)
-
Converts an HSLColour to HSV.
factory
- HSVColour.fromHSVColor(HSVColor hsvColor)
- Creates an HSVColour from a Flutter HSVColor.
Properties
- alpha → double
-
Alpha, from 0.0 to 1.0. The describes the transparency of the color.
A value of 0.0 is fully transparent, and 1.0 is fully opaque.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hue → double
-
Hue, from 0.0 to 360.0. Describes which color of the spectrum is
represented. A value of 0.0 represents red, as does 360.0. Values in
between go through all the hues representable in RGB. You can think of
this as selecting which pigment will be added to a color.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- saturation → double
-
Saturation, from 0.0 to 1.0. This describes how colorful the color is.
0.0 implies a shade of grey (i.e. no pigment), and 1.0 implies a color as
vibrant as that hue gets. You can think of this as the equivalent of
how much of a pigment is added.
final
- toHSVColour → HSVColour
-
Available on HSVColor, provided by the Hsvcolour extension
This colour as an HSVColour.no setter - value → double
-
Value, from 0.0 to 1.0. The "value" of a color that, in this context,
describes how bright a color is. A value of 0.0 indicates black, and 1.0
indicates full intensity color. You can think of this as the equivalent of
removing black from the color as value increases.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toColor(
) → Color -
Returns this color in RGB.
override
-
toColour(
) → Colour -
This colour as an RGB Colour.
override
-
toHSL(
) → HSLColour -
This colour as an HSLColour.
override
-
toHSV(
) → HSVColour -
This colour as an HSVColour.
override
-
toString(
) → String -
A string representation of this object.
override
-
withAlpha(
double alpha) → HSVColour -
Returns a copy of this color with the
alphaparameter replaced with the given value.override -
withHue(
double hue) → HSVColour -
Returns a copy of this color with the
hueparameter replaced with the given value.override -
withSaturation(
double saturation) → HSVColour -
Returns a copy of this color with the
saturationparameter replaced with the given value.override -
withValue(
double value) → HSVColour -
Returns a copy of this color with the
valueparameter replaced with the given value.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited