Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Color; public class Main { private static final int COLOR_FLOAT_TO_INT_FACTOR = 255; public static int RGBToColor(final float pRed, final float pGreen, final float pBlue) { return Color.rgb((int) (pRed * COLOR_FLOAT_TO_INT_FACTOR), (int) (pGreen * COLOR_FLOAT_TO_INT_FACTOR), (int) (pBlue * COLOR_FLOAT_TO_INT_FACTOR)); } }