Here you can find the source of RGBArray(Resources resources, int colorId)
public static float[] RGBArray(Resources resources, int colorId)
//package com.java2s; import android.content.res.Resources; public class Main { public static float[] RGBArray(Resources resources, int colorId) { int color = resources.getColor(colorId); float red = (color >> 16) & 0xFF; float green = (color >> 8) & 0xFF; float blue = (color >> 0) & 0xFF; float alpha = (color >> 24) & 0xFF; return new float[] { red / 255f, green / 255f, blue / 255f, alpha / 255f };/*from w w w.j a v a 2 s . c o m*/ } }