new color for grass, leaf and water

This commit is contained in:
Leonardo
2021-09-16 17:11:08 +02:00
parent fc4546538f
commit d911017112
2 changed files with 26 additions and 34 deletions
@@ -79,4 +79,17 @@ public class ColorUtil
hsv[1],
brightness).getRGB();
}
/**
* Edit the given color as a HSV (Hue Saturation Value) color.
*/
public static int changeBrightnessValue(int color, int brightnessColor)
{
float[] hsv = Color.RGBtoHSB(getRed(color), getGreen(color), getBlue(color), null);
float brightness = Color.RGBtoHSB(getRed(brightnessColor), getGreen(brightnessColor), getBlue(brightnessColor), null)[2];
return Color.getHSBColor(
hsv[0], // hue
hsv[1],
brightness).getRGB();
}
}