toDark static method
(en)Darkens the specified amount at the maximum.
(ja)最大で指定量暗くします。
c
: src color.level
: Maximum value to subtract from rgb.
Returns Color obj.
Implementation
static Color toDark(Color c, int level) {
int r = c.red - level >= 0 ? c.red - level : 0;
int g = c.green - level >= 0 ? c.green - level : 0;
int b = c.blue - level >= 0 ? c.blue - level : 0;
return Color.fromARGB(c.alpha, r, g, b);
}