Color3 class
class Color3 { int x; int y; int z; Color3() : x = 0, y = 0, z = 0; Color3.fromRGB(int r, int g, int b) : x = r, y = g, z = b; Color3.fromRGBF(double r, double g, double b) : x = (r * 255).floor().toInt(), y = (g * 255).floor().toInt(), z = (b * 255).floor().toInt(); Color3.fromColor3(Color3 color) : x = color.x, y = color.y, z = color.z; void setFromRGB(int r, int g, int b) { x = r; y = g; z = b; } void setFromRGBF(double r, double g, double b) { x = (r * 255).floor().toInt(); y = (g * 255).floor().toInt(); z = (b * 255).floor().toInt(); } void setFromColor3(Color3 color) { x = color.x; y = color.y; z = color.z; } bool operator ==(final other) { return other is Color3 && x == other.x && y == other.y && z == other.z; } }
Constructors
new Color3() #
Color3() : x = 0, y = 0, z = 0;
new Color3.fromColor3(Color3 color) #
Color3.fromColor3(Color3 color) : x = color.x, y = color.y, z = color.z;
new Color3.fromRGB(int r, int g, int b) #
Color3.fromRGB(int r, int g, int b) : x = r, y = g, z = b;
new Color3.fromRGBF(double r, double g, double b) #
Color3.fromRGBF(double r, double g, double b) : x = (r * 255).floor().toInt(), y = (g * 255).floor().toInt(), z = (b * 255).floor().toInt();
Operators
bool operator ==(other) #
The equality operator.
The default behavior for all Object
s is to return true if and
only if this
and
other are the same object.
If a subclass overrides the equality operator it should override
the hashCode
method as well to maintain consistency.
docs inherited from Object
bool operator ==(final other) { return other is Color3 && x == other.x && y == other.y && z == other.z; }
Methods
void setFromColor3(Color3 color) #
void setFromColor3(Color3 color) { x = color.x; y = color.y; z = color.z; }
void setFromRGB(int r, int g, int b) #
void setFromRGB(int r, int g, int b) { x = r; y = g; z = b; }
void setFromRGBF(double r, double g, double b) #
void setFromRGBF(double r, double g, double b) { x = (r * 255).floor().toInt(); y = (g * 255).floor().toInt(); z = (b * 255).floor().toInt(); }