Package javascript.awt
Class Color
- java.lang.Object
-
- javascript.awt.Color
-
public class Color extends java.lang.Object
The java.awt.Color clone- Author:
- gianpiero.diblasi
-
-
Constructor Summary
Constructors Constructor Description Color(int red, int green, int blue, int alpha)
Creates the object
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
CMYKtoRGB(def.js.Array<java.lang.Integer> cmyk, def.js.Array<java.lang.Integer> rgb)
Converts CMYK components of a color to a set of RGB componentsColor
darkened(double darkeningFactor)
Darkens this Color, the transparency is not changedstatic Color
fromARGB(int color)
Creates a Color from a ARGB integer colorstatic Color
fromARGB_HEX(java.lang.String color)
Creates a Color from an ARGB hex stringstatic Color
fromRGB(int color)
Creates a Color from a RGB integer colorstatic Color
fromRGB_HEX(java.lang.String color)
Creates a Color from an RGB hex stringstatic Color
fromRGBA(int color)
Creates a Color from a RGBA integer colorstatic Color
fromRGBA_HEX(java.lang.String color)
Creates a Color from an RGBA hex stringint
getARGB()
Returns the ARGB integer representing this Colordef.js.Array<java.lang.Integer>
getARGB_Components()
Returns the components of this Colorjava.lang.String
getARGB_HEX()
Returns the ARGB hex string representing this Colorint
getRGB()
Returns the RGB integer representing this Colordef.js.Array<java.lang.Integer>
getRGB_Components()
Returns the components of this Colorjava.lang.String
getRGB_HEX()
Returns the RGB hex string representing this Colorjava.lang.String
getRGB_String()
Returns the RGB string representing this Colorint
getRGBA()
Returns the RGBA integer representing this Colordef.js.Array<java.lang.Integer>
getRGBA_Components()
Returns the components of this Colorjava.lang.String
getRGBA_HEX()
Returns the RGBA hex string representing this Colorjava.lang.String
getRGBA_String()
Returns the RGBA string representing this ColorColor
gray()
Converts this Color to gray scaled, the transparency is not changedstatic void
HSLtoRGB(def.js.Array<java.lang.Double> hsl, def.js.Array<java.lang.Integer> rgb)
Converts HSL components of a color to a set of RGB componentsstatic void
HSVtoRGB(def.js.Array<java.lang.Double> hsv, def.js.Array<java.lang.Integer> rgb)
Converts HSV components of a color to a set of RGB componentsColor
lighted(double lightingFactor)
Lights up this Color, the transparency is not changedColor
negative()
Converts this Color to negative, the transparency is not changedstatic void
RGBtoCMYK(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Integer> cmyk)
Converts RGB components of a color to a set of CMYK componentsstatic void
RGBtoHSL(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> hsl)
Converts RGB components of a color to a set of HSL componentsstatic void
RGBtoHSV(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> hsv)
Converts RGB components of a color to a set of HSV componentsstatic void
RGBtoYUV(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> yuv)
Converts RGB components of a color to a set of YUV componentsstatic void
YUVtoRGB(def.js.Array<java.lang.Double> yuv, def.js.Array<java.lang.Integer> rgb)
Converts YUV components of a color to a set of RGB components
-
-
-
Constructor Detail
-
Color
public Color(int red, int green, int blue, int alpha)
Creates the object- Parameters:
red
- The red component (in the range [0,255])green
- The green component (in the range [0,255])blue
- The blue component (in the range [0,255])alpha
- The alpha component (in the range [0,255])
-
-
Method Detail
-
gray
public Color gray()
Converts this Color to gray scaled, the transparency is not changed- Returns:
- This gray scaled Color
-
negative
public Color negative()
Converts this Color to negative, the transparency is not changed- Returns:
- This negativized Color
-
lighted
public Color lighted(double lightingFactor)
Lights up this Color, the transparency is not changed- Parameters:
lightingFactor
- The lighting factor (in the range [0,1])- Returns:
- This lighted Color
-
darkened
public Color darkened(double darkeningFactor)
Darkens this Color, the transparency is not changed- Parameters:
darkeningFactor
- The darkening factor (in the range [0,1])- Returns:
- This darkened Color
-
getRGB
public int getRGB()
Returns the RGB integer representing this Color- Returns:
- The RGB integer representing this Color
-
getRGBA
public int getRGBA()
Returns the RGBA integer representing this Color- Returns:
- The RGBA integer representing this Color
-
getARGB
public int getARGB()
Returns the ARGB integer representing this Color- Returns:
- The ARGB integer representing this Color
-
getRGB_HEX
public java.lang.String getRGB_HEX()
Returns the RGB hex string representing this Color- Returns:
- The RGB hex string representing this Color
-
getRGB_String
public java.lang.String getRGB_String()
Returns the RGB string representing this Color- Returns:
- The RGB string representing this Color
-
getRGBA_HEX
public java.lang.String getRGBA_HEX()
Returns the RGBA hex string representing this Color- Returns:
- The RGBA hex string representing this Color
-
getRGBA_String
public java.lang.String getRGBA_String()
Returns the RGBA string representing this Color- Returns:
- The RGBA string representing this Color
-
getARGB_HEX
public java.lang.String getARGB_HEX()
Returns the ARGB hex string representing this Color- Returns:
- The ARGB hex string representing this Color
-
getRGB_Components
public def.js.Array<java.lang.Integer> getRGB_Components()
Returns the components of this Color- Returns:
- The components of Color
-
getRGBA_Components
public def.js.Array<java.lang.Integer> getRGBA_Components()
Returns the components of this Color- Returns:
- The components of Color
-
getARGB_Components
public def.js.Array<java.lang.Integer> getARGB_Components()
Returns the components of this Color- Returns:
- The components of Color
-
fromRGB
public static Color fromRGB(int color)
Creates a Color from a RGB integer color- Parameters:
color
- The color- Returns:
- The Color
-
fromRGBA
public static Color fromRGBA(int color)
Creates a Color from a RGBA integer color- Parameters:
color
- The color- Returns:
- The Color
-
fromARGB
public static Color fromARGB(int color)
Creates a Color from a ARGB integer color- Parameters:
color
- The color- Returns:
- The Color
-
fromRGB_HEX
public static Color fromRGB_HEX(java.lang.String color)
Creates a Color from an RGB hex string- Parameters:
color
- The color- Returns:
- The Color
-
fromRGBA_HEX
public static Color fromRGBA_HEX(java.lang.String color)
Creates a Color from an RGBA hex string- Parameters:
color
- The color- Returns:
- The Color
-
fromARGB_HEX
public static Color fromARGB_HEX(java.lang.String color)
Creates a Color from an ARGB hex string- Parameters:
color
- The color- Returns:
- The Color
-
HSLtoRGB
public static void HSLtoRGB(def.js.Array<java.lang.Double> hsl, def.js.Array<java.lang.Integer> rgb)
Converts HSL components of a color to a set of RGB components- Parameters:
hsl
- the hsl arrayrgb
- the rgb array
-
RGBtoHSL
public static void RGBtoHSL(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> hsl)
Converts RGB components of a color to a set of HSL components- Parameters:
rgb
- the rgb arrayhsl
- the hsl array
-
HSVtoRGB
public static void HSVtoRGB(def.js.Array<java.lang.Double> hsv, def.js.Array<java.lang.Integer> rgb)
Converts HSV components of a color to a set of RGB components- Parameters:
hsv
- the hsv arrayrgb
- the rgb array
-
RGBtoHSV
public static void RGBtoHSV(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> hsv)
Converts RGB components of a color to a set of HSV components- Parameters:
rgb
- the rgb arrayhsv
- the hsv array
-
CMYKtoRGB
public static void CMYKtoRGB(def.js.Array<java.lang.Integer> cmyk, def.js.Array<java.lang.Integer> rgb)
Converts CMYK components of a color to a set of RGB components- Parameters:
cmyk
- the cmyk arrayrgb
- the rgb array
-
RGBtoCMYK
public static void RGBtoCMYK(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Integer> cmyk)
Converts RGB components of a color to a set of CMYK components- Parameters:
rgb
- the rgb arraycmyk
- the cmyk array
-
YUVtoRGB
public static void YUVtoRGB(def.js.Array<java.lang.Double> yuv, def.js.Array<java.lang.Integer> rgb)
Converts YUV components of a color to a set of RGB components- Parameters:
yuv
- the yuv arrayrgb
- the rgb array
-
RGBtoYUV
public static void RGBtoYUV(def.js.Array<java.lang.Integer> rgb, def.js.Array<java.lang.Double> yuv)
Converts RGB components of a color to a set of YUV components- Parameters:
rgb
- the rgb arrayyuv
- the cmyk array
-
-