Returns rgba() string from SAC rgb LexicalUnit value - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

Returns rgba() string from SAC rgb LexicalUnit value

Demo Code


//package com.java2s;

public class Main {
    /**/* w  w w . j a  va 2  s .c  o  m*/
     * Returns rgba() string from SAC rgb LexicalUnit value
     * @param colors
     * @return
     */
    public static String RGBAfromRGB(int r, int g, int b) {
        return String.format("rgba(%s, %s, %s, %s)", r, g, b, 1F);
    }
}

Related Tutorials