Java Color to RGB String colourToString(Color colour)

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

Description

colour To String

License

Open Source License

Declaration

public static String colourToString(Color colour) 

Method Source Code


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

public class Main {
    public static String colourToString(Color colour) {
        if (colour == null) {
            return "extend";
        } else if (colour.getAlpha() == 0) {
            return "transparent";
        }/*from   w  w  w  . ja  v  a 2  s.c  o m*/
        return String.format("#%08X", colour.getRGB());
    }
}

Related

  1. colourToRgbString(Color colour)
  2. colourToString(java.awt.Color c)
  3. toRGB(Color c)
  4. toRGB(Color color)
  5. toRGB(ColorSpace colorSpace, float... components)