Java Color to RGB String colourToString(java.awt.Color c)

Here you can find the source of colourToString(java.awt.Color c)

Description

colour To String

License

Open Source License

Declaration

public static String colourToString(java.awt.Color c) 

Method Source Code

//package com.java2s;
/**//  w ww  .  j av a2s.c om
* @(#)SysUtil.java
* 
* Copyright (2003) Bro3
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2, or any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Boston, MA 02111.
*
* Contact: bro3@users.sourceforge.net
**/

public class Main {
    public static String colourToString(java.awt.Color c) {
        return Integer.toHexString(0xFF000000 | c.getRGB()).substring(2);
    }
}

Related

  1. colourToRgbString(Color colour)
  2. colourToString(Color colour)
  3. toRGB(Color c)
  4. toRGB(Color color)
  5. toRGB(ColorSpace colorSpace, float... components)
  6. toRGB(int red, int green, int blue)