Color.fromRGB constructor
Constructs a fully opaque color from the lower 8-bits of 3 integers.
Out of range values are brought into range using modulo (%
) `255.
This constructor is semantically identical to Color.fromARGB where
alpha is predefined as 255
(0xFF
), suitable for fully opaque colors
(i.e. where transparency is not intended or supported).
Implementation
const Color.fromRGB(
int r,
int g,
int b,
) : value = ((0xFF << 24) |
((r & 0xFF) << 16) |
((g & 0xFF) << 8) |
((b & 0xFF) << 0)) &
0xFFFFFFFF;