Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int calcColor(EnumChatFormatting formatting, boolean shadow)
- int index = formatting.getColorIndex();
- int j = (index >> 3 & 1) * 85;
- int r = (index >> 2 & 1) * 170 + j;
- int g = (index >> 1 & 1) * 170 + j;
- int b = (index >> 0 & 1) * 170 + j;
- if (formatting == EnumChatFormatting.GOLD)
- r += 85;
- if (gameSettings.anaglyph)
- {
- int rAnaglyph = (r * 30 + g * 59 + b * 11) / 100;
- int gAnaglyph = (r * 30 + g * 70) / 100;
- int bAnaglyph = (r * 30 + b * 70) / 100;
- r = rAnaglyph;
- g = gAnaglyph;
- b = bAnaglyph;
- }
- if (shadow)
- {
- r /= 4;
- g /= 4;
- b /= 4;
- }
- return (r & 0xFF) << 16 | (g & 0xFF) << 8 | b & 0xFF;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement