Color constructor
Construct a Color object with given RGB and alpha (i.e., opacity) values. *
-
red
,green
,blue
should be numbers between 0 (inclusive) and 255
- (inclusive);
-
alpha
should be a number between 0 (inclusive) and 1 (inclusive).
- Default: 1
Implementation
const Color(num red, num green, num blue, [num alpha = 1]) :
this.red = red, this.green = green, this.blue = blue, this.alpha = alpha;