Color

Class of android.graphics · Color.java · Android's reference

public class Color

ARGB colors as ints.

Page 1 2

Fields

public static final int BLACK = 0xff000000 source
public static final int DKGRAY = 0xff444444 source
public static final int GRAY = 0xff888888 source
public static final int LTGRAY = 0xffcccccc source
public static final int WHITE = 0xffffffff source
public static final int RED = 0xffff0000 source
public static final int GREEN = 0xff00ff00 source
public static final int BLUE = 0xff0000ff source
public static final int YELLOW = 0xffffff00 source
public static final int CYAN = 0xff00ffff source
public static final int MAGENTA = 0xffff00ff source
public static final int TRANSPARENT = 0 source

Constructors

public Color() source

Methods

public static int alpha(int color) source
public static int red(int color) source
public static int green(int color) source
public static int blue(int color) source
public static int rgb(int red, int green, int blue) source
public static int rgb(float red, float green, float blue) source
public static int argb(int alpha, int red, int green, int blue) source
public static int argb(float alpha, float red, float green, float blue) source
public static float luminance(int color) source
public static float luminance(long color) source
public static boolean isWideGamut(long color) source
public static long pack(int color) source

A color long in sRGB: the int's components as Android's half-float-free encoding of sRGB colors.

public static long pack(float red, float green, float blue) source
public static long pack(float red, float green, float blue, float alpha) source
public static long pack(float red, float green, float blue, float alpha, ColorSpace colorSpace) source
public static int toArgb(long color) source
public static long convert(long color, ColorSpace colorSpace) source
public static long convert(int color, ColorSpace colorSpace) source
public static boolean isSrgb(long color) source
public static boolean isInColorSpace(long color, ColorSpace cs) source
public static ColorSpace colorSpace(long color) source
public static float red(long color) source

A color long's components: sRGB ones as 8-bit, others (from the colorspace's half floats) as Android packs them.

public static float green(long color) source
public static float blue(long color) source
public static float alpha(long color) source
public static Color valueOf(int color) source
public static Color valueOf(long color) source
public static Color valueOf(float r, float g, float b) source
public static Color valueOf(float r, float g, float b, float a) source
public static Color valueOf(float[] components, ColorSpace colorSpace) source
public int toArgb() source
public long pack() source

Page 1 2


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.