Color class

Constructors

Color([dynamic r, double? g, double? b])
Color class. r g b value range (0.0 ~ 1.0) var color = Color(0xff00ff); var color = Color(1.0, 0.0, 1.0); var color = Color("#ff00ee"); r is three.Color, hex or string
Color.fromArray(List<int> list)
factory
Color.setRGB255(int r, int g, int b)
factory
Color.setRGBArray(List<double> cl)
factory

Properties

b double
getter/setter pair
g double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isColor bool
getter/setter pair
isTexture bool
getter/setter pair
r double
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
getter/setter pair

Methods

add(Color color) Color
addColors(Color color1, Color color2) Color
addScalar(num s) Color
clone() Color
convertGammaToLinear([double? gammaFactor]) Color
convertLinearToGamma([double? gammaFactor]) Color
convertLinearToSRGB() Color
convertSRGBToLinear() Color
copy(Color color) Color
copyGammaToLinear(Color color, [double gammaFactor = 2.0]) Color
copyLinearToGamma(Color color, [double gammaFactor = 2.0]) Color
copyLinearToSRGB(Color color) Color
copySRGBToLinear(Color color) Color
equal(Color color) bool
equals(Color c) bool
fromArray(List<double> array, [int offset = 0]) Color
fromBufferAttribute(BufferAttribute<NativeArray<num>> attribute, int index) Color
getHex([String colorSpace = SRGBColorSpace]) int
getHexString([String colorSpace = SRGBColorSpace]) String
getHSL(HslData target, [String colorSpace = LinearSRGBColorSpace]) HslData
getRGB(dynamic target, [String colorSpace = LinearSRGBColorSpace]) → dynamic
getStyle([String colorSpace = SRGBColorSpace]) → dynamic
isBlack() bool
lerp(Color color, num alpha) Color
lerpColors(Color color1, Color color2, num alpha) Color
lerpHSL(Color color, num alpha) Color
multiply(Color color) Color
multiplyScalar(num s) Color
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetHSL(double h, double s, double l) Color
set<T>(T? value) Color
setColorName(String style, [String colorSpace = SRGBColorSpace]) Color
setHex(int hex, [String colorSpace = SRGBColorSpace]) Color
setHSL(double h, double s, double l, [String colorSpace = LinearSRGBColorSpace]) Color
setRGB([double? r, double? g, double? b, String colorSpace = LinearSRGBColorSpace]) Color
setScalar(double scalar) Color
setStyle([String style = '', String colorSpace = SRGBColorSpace]) Color
sub(Color color) Color
toArray([dynamic array, int offset = 0]) List<double>
dart array can not expand default so have to set array length enough first.
toJSON() int
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromHex(int hex) Color

Constants

names → const Map<String, int>