Java Color to RGB String colourToRgbString(Color colour)

Here you can find the source of colourToRgbString(Color colour)

Description

colour To Rgb String

License

Open Source License

Declaration

public static String colourToRgbString(Color colour) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

public class Main {
    public static String colourToRgbString(int rgb) {
        return new String((rgb >> 16 & 0xFF) + ", " + (rgb >> 8 & 0xFF) + ", " + (rgb & 0xFF));
    }//from w w w. j  a  va2 s .c  om

    public static String colourToRgbString(Color colour) {
        return new String(colour.getRed() + ", " + colour.getGreen() + ", " + colour.getBlue());
    }
}

Related

  1. colourToString(Color colour)
  2. colourToString(java.awt.Color c)
  3. toRGB(Color c)
  4. toRGB(Color color)