color To RGB - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

color To RGB

Demo Code


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

public class Main {
    public static int[] colorToRGB(Color color) {
        int[] rgb = new int[3];
        rgb[0] = color.getRed();/*w  w w  .  jav a  2s .c o  m*/
        rgb[1] = color.getGreen();
        rgb[2] = color.getBlue();
        return rgb;
    }
}

Related Tutorials