Color class

Constructors

Color([int red = 0, int green = 0, int blue = 0, double? alpha])
Constructor create Color from rgba components. Default value for red, green and blue component is 0, for alpha- null For color with specified alpha component output format will be rgba.
const

Properties

alpha double?
Return opacity level (null or 0-1)
final
blue int
Return blue component (0-255)
final
green int
Return green component (0-255)
final
hashCode int
The hash code for this object.
no setterinherited
red int
Return red component (0-255)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toHexString([String template = '%r%g%b']) String
Output color in hex format
toList({List? template, bool asDouble = false, int? range, int rows = 1}) List
Output color as List object By default, the list will be output in rgb or rgba format, depending on the format of this object. You can also specify an arbitrary number and order of the components are specify in the template. Default values rgb component output as int. You can change this bypassing a true argument asDouble. All rgb components of the default set in the range of 0-255, but you can change this by specifying a range argument range from 0-range (eg from 0 to 1). It is also possible to deduce the components several times, specify the argument rows. This may be necessary when you need to set the same color for each vertex in the polygon 3D model.
toMap({Map? template, bool asDouble = false, int? range}) Map
Output color as Map object By default, the map will be output with the keys "red", "green" and "blue". "alpha" will be displayed depending on the format of the object. You can also specify an arbitrary number of components of said template. Default values rgb component output as int. You can change this by passing a true argument asDouble. All rgb components of the default set in the range of 0-255, but you can change this by specifying a range argument needs range from 0-range (eg from 0 to 1).
toRgbaString([String template = 'rgba(%r, %g, %b, %a)']) String
Output color in rgba format
toRgbString([String template = 'rgb(%r, %g, %b)']) String
Output color in rgb format
toString([dynamic template = null]) String
Output color as string in rgba(r, g, b, a) or rgb(r, g, b) format
override

Operators

operator +(Color other) Color
operator -(Color other) Color
operator ==(Object other) bool
The equality operator.
override