Java Color Encode encode(Color color)

Here you can find the source of encode(Color color)

Description

encode

License

Open Source License

Declaration

public static String encode(Color color) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static String encode(Color color) {
        if (color == null) {
            return null;
        }/*  w w w .j  av a2s  .c om*/

        int r = color.getRed();
        int g = color.getGreen();
        int b = color.getBlue();
        int a = color.getAlpha();
        return String.format("0x%02x%02x%02x%02x", r, g, b, a);
    }
}

Related

  1. encode(Color c)
  2. encode(Color color)
  3. encode(Color color)
  4. encode(Color color)
  5. encode(java.awt.Color c)
  6. encodeColor(Color color)
  7. encodeColor(Color color)
  8. encodeColor(Color color)