get Color By RGB from an array - Android Graphics

Android examples for Graphics:Color RGB Value

Description

get Color By RGB from an array

Demo Code


//package com.java2s;
import android.graphics.Color;

public class Main {

    public static int getColorByRGB(int[] intRgb) {
        if (intRgb.length != 3) {
            return 0xffffff;
        }/*from w w  w.  j  a  v a 2 s  .  c o  m*/
        return Color.rgb(intRgb[0], intRgb[1], intRgb[2]);
    }
}

Related Tutorials