rgb To Color - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

rgb To Color

Demo Code


//package com.java2s;
import java.awt.Color;

public class Main {
    public static void main(String[] argv) throws Exception {
        int[] rgb = new int[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 };
        System.out.println(rgbToColor(rgb));
    }/*  w ww . j  av a2 s  .c  om*/

    /**
     *
     */
    public static Color rgbToColor(int[] rgb) {
        return new Color(rgb[0], rgb[1], rgb[2]);
    }
}

Related Tutorials