Android Color Convert RGBToColor(final float pRed, final float pGreen, final float pBlue)

Here you can find the source of RGBToColor(final float pRed, final float pGreen, final float pBlue)

Description

RGB To Color

Declaration

public static int RGBToColor(final float pRed, final float pGreen,
            final float pBlue) 

Method Source Code

//package com.java2s;
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));
    }// w ww .j av a2  s .c om
}

Related

  1. getArgb(int color)
  2. getColorFromArgb(int[] argb)
  3. decodeYUV420SP(int[] rgb, byte[] yuv420sp, int width, int height)
  4. decodeYUV420SP(int[] rgb, byte[] yuv420sp, int width, int height)