Here you can find the source of getArgb(int color)
Parameter | Description |
---|---|
color | a parameter |
public static int[] getArgb(int color)
//package com.java2s; public class Main { /**/*from www .ja va 2 s . c om*/ * Gets an ARGB int array from a provided color * * @param color * @return */ public static int[] getArgb(int color) { final int a = (color >>> 24); final int r = (color >> 16) & 0xFF; final int g = (color >> 8) & 0xFF; final int b = (color) & 0xFF; return new int[] { ClippedColorPart(a), ClippedColorPart(r), ClippedColorPart(g), ClippedColorPart(b) }; } public static int ClippedColorPart(int color) { if (color < 0) { return 0; } else if (color > 0xFF) { return 0xFF; } return color; } }