2 // Getdown - application installer, patcher and launcher
3 // Copyright (C) 2004-2018 Getdown authors
4 // https://github.com/threerings/getdown/blob/master/LICENSE
6 package com.threerings.getdown.util;
9 * Utilities for handling ARGB colors.
13 public final static int CLEAR = 0x00000000;
14 public final static int WHITE = 0xFFFFFFFF;
15 public final static int BLACK = 0xFF000000;
17 public static float brightness (int argb) {
18 // TODO: we're ignoring alpha here...
19 int red = (argb >> 16) & 0xFF;
20 int green = (argb >> 8) & 0xFF;
21 int blue = (argb >> 0) & 0xFF;
22 int max = Math.max(Math.max(red, green), blue);
23 return ((float) max) / 255.0f;