gui disabled colors

This commit is contained in:
Sen 2025-03-28 01:01:16 +01:00
parent 6a6a820963
commit 3316c42ed8
10 changed files with 64 additions and 19 deletions

View file

@ -287,4 +287,10 @@ int utf_len(const char *str) {
return ((((c1 >> 24 & 255) + (c2 >> 24 & 255)) / 2) << 24) | ((((c1 >> 16 & 255) + (c2 >> 16 & 255)) / 2) << 16) | ((((c1 >> 8 & 255) + (c2 >> 8 & 255)) / 2) << 8) |
(((c1 & 255) + (c2 & 255)) / 2);
}
public static int mulColor(int color, float brightness) {
int mul = ExtMath.clampi((int)(brightness * 255.0f), 0, 255);
return (color & 0xff000000) | ((((color >> 16 & 255) * mul) / 255) << 16) | ((((color >> 8 & 255) * mul) / 255) << 8) |
(((color & 255) * mul) / 255);
}
}