adjustDarkness static method
Implementation
static Color adjustDarkness(Color color, double factor) {
int value = color.value;
int a = (value >> 24) & 0xFF;
int r = (((value >> 16) & 0xFF) * factor).toInt();
int g = (((value >> 8) & 0xFF) * factor).toInt();
int b = ((value & 0xFF) * factor).toInt();
value = (a << 24) | (r << 16) | (g << 8) | b;
return Color(value);
}