RgbColour class
- Implemented types
Constructors
- RgbColour.new(int? red, int? green, int? blue)
- RgbColour.parse(String? hexTriplet)
-
Parses hex color string
factory
- RgbColour.parseHtmlColour(String? colorString)
-
Parses HTML color string
factory
- RgbColour.parseRgbString(String rgbString)
-
Parse an RGB string, e.g. rgb(0, 0, 0)
factory
Properties
Methods
-
brighten(
double factor) → RgbColour - @param factor A factor less than 1.0 will darken the colour.
-
brightnessDiff(
RgbColour prime) → int -
colorDiff(
RgbColour rgb1) → int - Calculate color difference between two colors. Helper method for goog.color.highContrast() @param {goog.color.Rgb} rgb1 Colour represented by a rgb array. @param {goog.color.Rgb} rgb2 Colour represented by a rgb array. @return {number} Colour difference. @private
-
copy(
) → RgbColour - @return {!goog.math.Rect} A new copy of this Rectangle.
-
diff(
RgbColour prime) → int -
getColourLuma(
) → double -
Returns the color intensity (luma) for the specified
color
Value ranges from0..1
-
getDisplayName(
) → String - Gets colour's display name
-
getHsvValueComponent(
) → int - Gets the Value (V) component in the HSV color space
-
highContrast(
List< RgbColour> suggestions) → RgbColour -
highContrastBW(
) → RgbColour -
marshal(
MarshalledObject marshalled) → void -
Marshal method must operate by mutating empty object passed.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toCssValue(
) → String - To css color value.
-
toHexTriplet(
) → String - Serializes to hex color
-
toHtmlHexTriplet(
) → String - To HTML color.
-
toRgbaString(
double alpha) → String - As rgb with alpha channel
-
toString(
) → String -
Default format
override
-
yiqBrightness(
) → int - Calculate brightness of a color according to YIQ formula (brightness is Y). More info on YIQ here: http://en.wikipedia.org/wiki/YIQ. Helper method for goog.color.highContrast() @param {goog.color.Rgb} rgb Colour represented by a rgb array. @return {number} brightness (Y). @private
-
yiqBrightnessDiff(
RgbColour rgb1) → int - Calculate difference in brightness of two colors. Helper method for goog.color.highContrast() @param {goog.color.Rgb} rgb1 Colour represented by a rgb array. @param {goog.color.Rgb} rgb2 Colour represented by a rgb array. @return {number} Brightness difference. @private
Operators
-
operator *(
num value) → RgbColour - Operator overloading for Dart API.
-
operator +(
RgbColour other) → RgbColour -
operator -(
RgbColour other) → RgbColour -
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
-
BLACK_AND_WHITE
→ List<
RgbColour> -
final
- BLACK_COLOUR → RgbColour
-
final
- EMPTY_COLOR_CSSVALUE → String
-
final
- EMPTY_COLOUR → RgbColour
-
Colour which has no effect.
final
- EMPTY_COLOUR_DISPLAY_NAME → String
-
final
- WHITE_COLOUR → RgbColour
-
final
Static Methods
-
getHueColour(
num angle) → RgbColour -
Get the pure color from the Hue
angle
.angle
is in radians -
unmarshal(
MarshalledObject marshalled) → RgbColour - Encoded object parameter is encoded depending on format.