Class Color

java.lang.Object
io.deephaven.gui.color.Color
All Implemented Interfaces:
Paint, Serializable

public class Color extends Object implements Paint, Serializable
A color. TODO (deephaven/deephaven-core/issues/175): Move this to a new module and package
See Also:
  • Field Details

    • ALICEBLUE

      public static Color ALICEBLUE
    • ANTIQUEWHITE

      public static Color ANTIQUEWHITE
    • AQUA

      public static Color AQUA
    • AQUAMARINE

      public static Color AQUAMARINE
    • AZURE

      public static Color AZURE
    • BEIGE

      public static Color BEIGE
    • BISQUE

      public static Color BISQUE
    • BLACK

      public static Color BLACK
    • BLANCHEDALMOND

      public static Color BLANCHEDALMOND
    • BLUE

      public static Color BLUE
    • BLUEVIOLET

      public static Color BLUEVIOLET
    • BROWN

      public static Color BROWN
    • BURLYWOOD

      public static Color BURLYWOOD
    • CADETBLUE

      public static Color CADETBLUE
    • CHARTREUSE

      public static Color CHARTREUSE
    • CHOCOLATE

      public static Color CHOCOLATE
    • CORAL

      public static Color CORAL
    • CORNFLOWERBLUE

      public static Color CORNFLOWERBLUE
    • CORNSILK

      public static Color CORNSILK
    • CRIMSON

      public static Color CRIMSON
    • CYAN

      public static Color CYAN
    • DARKBLUE

      public static Color DARKBLUE
    • DARKCYAN

      public static Color DARKCYAN
    • DARKGOLDENROD

      public static Color DARKGOLDENROD
    • DARKGRAY

      public static Color DARKGRAY
    • DARKGREY

      public static Color DARKGREY
    • DARKGREEN

      public static Color DARKGREEN
    • DARKKHAKI

      public static Color DARKKHAKI
    • DARKMAGENTA

      public static Color DARKMAGENTA
    • DARKOLIVEGREEN

      public static Color DARKOLIVEGREEN
    • DARKORANGE

      public static Color DARKORANGE
    • DARKORCHID

      public static Color DARKORCHID
    • DARKRED

      public static Color DARKRED
    • DARKSALMON

      public static Color DARKSALMON
    • DARKSEAGREEN

      public static Color DARKSEAGREEN
    • DARKSLATEBLUE

      public static Color DARKSLATEBLUE
    • DARKSLATEGRAY

      public static Color DARKSLATEGRAY
    • DARKSLATEGREY

      public static Color DARKSLATEGREY
    • DARKTURQUOISE

      public static Color DARKTURQUOISE
    • DARKVIOLET

      public static Color DARKVIOLET
    • DEEPPINK

      public static Color DEEPPINK
    • DEEPSKYBLUE

      public static Color DEEPSKYBLUE
    • DIMGRAY

      public static Color DIMGRAY
    • DIMGREY

      public static Color DIMGREY
    • DODGERBLUE

      public static Color DODGERBLUE
    • FIREBRICK

      public static Color FIREBRICK
    • FLORALWHITE

      public static Color FLORALWHITE
    • FORESTGREEN

      public static Color FORESTGREEN
    • FUCHSIA

      public static Color FUCHSIA
    • GAINSBORO

      public static Color GAINSBORO
    • GHOSTWHITE

      public static Color GHOSTWHITE
    • GOLD

      public static Color GOLD
    • GOLDENROD

      public static Color GOLDENROD
    • GRAY

      public static Color GRAY
    • GREY

      public static Color GREY
    • GREEN

      public static Color GREEN
    • GREENYELLOW

      public static Color GREENYELLOW
    • HONEYDEW

      public static Color HONEYDEW
    • HOTPINK

      public static Color HOTPINK
    • INDIANRED

      public static Color INDIANRED
    • INDIGO

      public static Color INDIGO
    • IVORY

      public static Color IVORY
    • KHAKI

      public static Color KHAKI
    • LAVENDER

      public static Color LAVENDER
    • LAVENDERBLUSH

      public static Color LAVENDERBLUSH
    • LAWNGREEN

      public static Color LAWNGREEN
    • LEMONCHIFFON

      public static Color LEMONCHIFFON
    • LIGHTBLUE

      public static Color LIGHTBLUE
    • LIGHTCORAL

      public static Color LIGHTCORAL
    • LIGHTCYAN

      public static Color LIGHTCYAN
    • LIGHTGOLDENRODYELLOW

      public static Color LIGHTGOLDENRODYELLOW
    • LIGHTGRAY

      public static Color LIGHTGRAY
    • LIGHTGREY

      public static Color LIGHTGREY
    • LIGHTGREEN

      public static Color LIGHTGREEN
    • LIGHTPINK

      public static Color LIGHTPINK
    • LIGHTSALMON

      public static Color LIGHTSALMON
    • LIGHTSEAGREEN

      public static Color LIGHTSEAGREEN
    • LIGHTSKYBLUE

      public static Color LIGHTSKYBLUE
    • LIGHTSLATEGRAY

      public static Color LIGHTSLATEGRAY
    • LIGHTSLATEGREY

      public static Color LIGHTSLATEGREY
    • LIGHTSTEELBLUE

      public static Color LIGHTSTEELBLUE
    • LIGHTYELLOW

      public static Color LIGHTYELLOW
    • LIME

      public static Color LIME
    • LIMEGREEN

      public static Color LIMEGREEN
    • LINEN

      public static Color LINEN
    • MAGENTA

      public static Color MAGENTA
    • MAROON

      public static Color MAROON
    • MEDIUMAQUAMARINE

      public static Color MEDIUMAQUAMARINE
    • MEDIUMBLUE

      public static Color MEDIUMBLUE
    • MEDIUMORCHID

      public static Color MEDIUMORCHID
    • MEDIUMPURPLE

      public static Color MEDIUMPURPLE
    • MEDIUMSEAGREEN

      public static Color MEDIUMSEAGREEN
    • MEDIUMSLATEBLUE

      public static Color MEDIUMSLATEBLUE
    • MEDIUMSPRINGGREEN

      public static Color MEDIUMSPRINGGREEN
    • MEDIUMTURQUOISE

      public static Color MEDIUMTURQUOISE
    • MEDIUMVIOLETRED

      public static Color MEDIUMVIOLETRED
    • MIDNIGHTBLUE

      public static Color MIDNIGHTBLUE
    • MINTCREAM

      public static Color MINTCREAM
    • MISTYROSE

      public static Color MISTYROSE
    • MOCCASIN

      public static Color MOCCASIN
    • OLDLACE

      public static Color OLDLACE
    • OLIVE

      public static Color OLIVE
    • OLIVEDRAB

      public static Color OLIVEDRAB
    • ORANGE

      public static Color ORANGE
    • ORANGERED

      public static Color ORANGERED
    • ORCHID

      public static Color ORCHID
    • PALEGOLDENROD

      public static Color PALEGOLDENROD
    • PALEGREEN

      public static Color PALEGREEN
    • PALETURQUOISE

      public static Color PALETURQUOISE
    • PALEVIOLETRED

      public static Color PALEVIOLETRED
    • PAPAYAWHIP

      public static Color PAPAYAWHIP
    • PEACHPUFF

      public static Color PEACHPUFF
    • PERU

      public static Color PERU
    • PINK

      public static Color PINK
    • PLUM

      public static Color PLUM
    • POWDERBLUE

      public static Color POWDERBLUE
    • PURPLE

      public static Color PURPLE
    • REBECCAPURPLE

      public static Color REBECCAPURPLE
    • RED

      public static Color RED
    • ROSYBROWN

      public static Color ROSYBROWN
    • ROYALBLUE

      public static Color ROYALBLUE
    • SADDLEBROWN

      public static Color SADDLEBROWN
    • SALMON

      public static Color SALMON
    • SANDYBROWN

      public static Color SANDYBROWN
    • SEAGREEN

      public static Color SEAGREEN
    • SEASHELL

      public static Color SEASHELL
    • SIENNA

      public static Color SIENNA
    • SILVER

      public static Color SILVER
    • SKYBLUE

      public static Color SKYBLUE
    • SLATEBLUE

      public static Color SLATEBLUE
    • SLATEGRAY

      public static Color SLATEGRAY
    • SLATEGREY

      public static Color SLATEGREY
    • SNOW

      public static Color SNOW
    • SPRINGGREEN

      public static Color SPRINGGREEN
    • STEELBLUE

      public static Color STEELBLUE
    • TAN

      public static Color TAN
    • TEAL

      public static Color TEAL
    • THISTLE

      public static Color THISTLE
    • TOMATO

      public static Color TOMATO
    • TURQUOISE

      public static Color TURQUOISE
    • VIOLET

      public static Color VIOLET
    • WHEAT

      public static Color WHEAT
    • WHITE

      public static Color WHITE
    • WHITESMOKE

      public static Color WHITESMOKE
    • YELLOW

      public static Color YELLOW
    • YELLOWGREEN

      public static Color YELLOWGREEN
    • VIVID_RED

      public static Color VIVID_RED
    • VIVID_YELLOWRED

      public static Color VIVID_YELLOWRED
    • VIVID_YELLOW

      public static Color VIVID_YELLOW
    • VIVID_GREENYELLOW

      public static Color VIVID_GREENYELLOW
    • VIVID_GREEN

      public static Color VIVID_GREEN
    • VIVID_BLUEGREEN

      public static Color VIVID_BLUEGREEN
    • VIVID_BLUE

      public static Color VIVID_BLUE
    • VIVID_PURPLEBLUE

      public static Color VIVID_PURPLEBLUE
    • VIVID_PURPLE

      public static Color VIVID_PURPLE
    • VIVID_REDPURPLE

      public static Color VIVID_REDPURPLE
    • STRONG_RED

      public static Color STRONG_RED
    • STRONG_YELLOWRED

      public static Color STRONG_YELLOWRED
    • STRONG_YELLOW

      public static Color STRONG_YELLOW
    • STRONG_GREENYELLOW

      public static Color STRONG_GREENYELLOW
    • STRONG_GREEN

      public static Color STRONG_GREEN
    • STRONG_BLUEGREEN

      public static Color STRONG_BLUEGREEN
    • STRONG_BLUE

      public static Color STRONG_BLUE
    • STRONG_PURPLEBLUE

      public static Color STRONG_PURPLEBLUE
    • STRONG_PURPLE

      public static Color STRONG_PURPLE
    • STRONG_REDPURPLE

      public static Color STRONG_REDPURPLE
    • BRIGHT_RED

      public static Color BRIGHT_RED
    • BRIGHT_YELLOWRED

      public static Color BRIGHT_YELLOWRED
    • BRIGHT_YELLOW

      public static Color BRIGHT_YELLOW
    • BRIGHT_GREENYELLOW

      public static Color BRIGHT_GREENYELLOW
    • BRIGHT_GREEN

      public static Color BRIGHT_GREEN
    • BRIGHT_BLUEGREEN

      public static Color BRIGHT_BLUEGREEN
    • BRIGHT_BLUE

      public static Color BRIGHT_BLUE
    • BRIGHT_PURPLEBLUE

      public static Color BRIGHT_PURPLEBLUE
    • BRIGHT_PURPLE

      public static Color BRIGHT_PURPLE
    • BRIGHT_REDPURPLE

      public static Color BRIGHT_REDPURPLE
    • PALE_RED

      public static Color PALE_RED
    • PALE_YELLOWRED

      public static Color PALE_YELLOWRED
    • PALE_YELLOW

      public static Color PALE_YELLOW
    • PALE_GREENYELLOW

      public static Color PALE_GREENYELLOW
    • PALE_GREEN

      public static Color PALE_GREEN
    • PALE_BLUEGREEN

      public static Color PALE_BLUEGREEN
    • PALE_BLUE

      public static Color PALE_BLUE
    • PALE_PURPLEBLUE

      public static Color PALE_PURPLEBLUE
    • PALE_PURPLE

      public static Color PALE_PURPLE
    • PALE_REDPURPLE

      public static Color PALE_REDPURPLE
    • VERYPALE_RED

      public static Color VERYPALE_RED
    • VERYPALE_YELLOWRED

      public static Color VERYPALE_YELLOWRED
    • VERYPALE_YELLOW

      public static Color VERYPALE_YELLOW
    • VERYPALE_GREENYELLOW

      public static Color VERYPALE_GREENYELLOW
    • VERYPALE_GREEN

      public static Color VERYPALE_GREEN
    • VERYPALE_BLUEGREEN

      public static Color VERYPALE_BLUEGREEN
    • VERYPALE_BLUE

      public static Color VERYPALE_BLUE
    • VERYPALE_PURPLEBLUE

      public static Color VERYPALE_PURPLEBLUE
    • VERYPALE_PURPLE

      public static Color VERYPALE_PURPLE
    • VERYPALE_REDPURPLE

      public static Color VERYPALE_REDPURPLE
    • LIGHTGRAYISH_RED

      public static Color LIGHTGRAYISH_RED
    • LIGHTGRAYISH_YELLOWRED

      public static Color LIGHTGRAYISH_YELLOWRED
    • LIGHTGRAYISH_YELLOW

      public static Color LIGHTGRAYISH_YELLOW
    • LIGHTGRAYISH_GREENYELLOW

      public static Color LIGHTGRAYISH_GREENYELLOW
    • LIGHTGRAYISH_GREEN

      public static Color LIGHTGRAYISH_GREEN
    • LIGHTGRAYISH_BLUEGREEN

      public static Color LIGHTGRAYISH_BLUEGREEN
    • LIGHTGRAYISH_BLUE

      public static Color LIGHTGRAYISH_BLUE
    • LIGHTGRAYISH_PURPLEBLUE

      public static Color LIGHTGRAYISH_PURPLEBLUE
    • LIGHTGRAYISH_PURPLE

      public static Color LIGHTGRAYISH_PURPLE
    • LIGHTGRAYISH_REDPURPLE

      public static Color LIGHTGRAYISH_REDPURPLE
    • LIGHT_RED

      public static Color LIGHT_RED
    • LIGHT_YELLOWRED

      public static Color LIGHT_YELLOWRED
    • LIGHT_YELLOW

      public static Color LIGHT_YELLOW
    • LIGHT_GREENYELLOW

      public static Color LIGHT_GREENYELLOW
    • LIGHT_GREEN

      public static Color LIGHT_GREEN
    • LIGHT_BLUEGREEN

      public static Color LIGHT_BLUEGREEN
    • LIGHT_BLUE

      public static Color LIGHT_BLUE
    • LIGHT_PURPLEBLUE

      public static Color LIGHT_PURPLEBLUE
    • LIGHT_PURPLE

      public static Color LIGHT_PURPLE
    • LIGHT_REDPURPLE

      public static Color LIGHT_REDPURPLE
    • GRAYISH_RED

      public static Color GRAYISH_RED
    • GRAYISH_YELLOWRED

      public static Color GRAYISH_YELLOWRED
    • GRAYISH_YELLOW

      public static Color GRAYISH_YELLOW
    • GRAYISH_GREENYELLOW

      public static Color GRAYISH_GREENYELLOW
    • GRAYISH_GREEN

      public static Color GRAYISH_GREEN
    • GRAYISH_BLUEGREEN

      public static Color GRAYISH_BLUEGREEN
    • GRAYISH_BLUE

      public static Color GRAYISH_BLUE
    • GRAYISH_PURPLEBLUE

      public static Color GRAYISH_PURPLEBLUE
    • GRAYISH_PURPLE

      public static Color GRAYISH_PURPLE
    • GRAYISH_REDPURPLE

      public static Color GRAYISH_REDPURPLE
    • DULL_RED

      public static Color DULL_RED
    • DULL_YELLOWRED

      public static Color DULL_YELLOWRED
    • DULL_YELLOW

      public static Color DULL_YELLOW
    • DULL_GREENYELLOW

      public static Color DULL_GREENYELLOW
    • DULL_GREEN

      public static Color DULL_GREEN
    • DULL_BLUEGREEN

      public static Color DULL_BLUEGREEN
    • DULL_BLUE

      public static Color DULL_BLUE
    • DULL_PURPLEBLUE

      public static Color DULL_PURPLEBLUE
    • DULL_PURPLE

      public static Color DULL_PURPLE
    • DULL_REDPURPLE

      public static Color DULL_REDPURPLE
    • DEEP_RED

      public static Color DEEP_RED
    • DEEP_YELLOWRED

      public static Color DEEP_YELLOWRED
    • DEEP_YELLOW

      public static Color DEEP_YELLOW
    • DEEP_GREENYELLOW

      public static Color DEEP_GREENYELLOW
    • DEEP_GREEN

      public static Color DEEP_GREEN
    • DEEP_BLUEGREEN

      public static Color DEEP_BLUEGREEN
    • DEEP_BLUE

      public static Color DEEP_BLUE
    • DEEP_PURPLEBLUE

      public static Color DEEP_PURPLEBLUE
    • DEEP_PURPLE

      public static Color DEEP_PURPLE
    • DEEP_REDPURPLE

      public static Color DEEP_REDPURPLE
    • DARK_RED

      public static Color DARK_RED
    • DARK_YELLOWRED

      public static Color DARK_YELLOWRED
    • DARK_YELLOW

      public static Color DARK_YELLOW
    • DARK_GREENYELLOW

      public static Color DARK_GREENYELLOW
    • DARK_GREEN

      public static Color DARK_GREEN
    • DARK_BLUEGREEN

      public static Color DARK_BLUEGREEN
    • DARK_BLUE

      public static Color DARK_BLUE
    • DARK_PURPLEBLUE

      public static Color DARK_PURPLEBLUE
    • DARK_PURPLE

      public static Color DARK_PURPLE
    • DARK_REDPURPLE

      public static Color DARK_REDPURPLE
    • DARKGRAYISH_RED

      public static Color DARKGRAYISH_RED
    • DARKGRAYISH_YELLOWRED

      public static Color DARKGRAYISH_YELLOWRED
    • DARKGRAYISH_YELLOW

      public static Color DARKGRAYISH_YELLOW
    • DARKGRAYISH_GREENYELLOW

      public static Color DARKGRAYISH_GREENYELLOW
    • DARKGRAYISH_GREEN

      public static Color DARKGRAYISH_GREEN
    • DARKGRAYISH_BLUEGREEN

      public static Color DARKGRAYISH_BLUEGREEN
    • DARKGRAYISH_BLUE

      public static Color DARKGRAYISH_BLUE
    • DARKGRAYISH_PURPLEBLUE

      public static Color DARKGRAYISH_PURPLEBLUE
    • DARKGRAYISH_PURPLE

      public static Color DARKGRAYISH_PURPLE
    • DARKGRAYISH_REDPURPLE

      public static Color DARKGRAYISH_REDPURPLE
    • GRAY1

      public static Color GRAY1
    • GRAY2

      public static Color GRAY2
    • GRAY3

      public static Color GRAY3
    • GRAY4

      public static Color GRAY4
    • GRAY5

      public static Color GRAY5
    • GRAY6

      public static Color GRAY6
    • GRAY7

      public static Color GRAY7
    • GRAY8

      public static Color GRAY8
    • DB_PINK

      public static Color DB_PINK
    • DB_ORANGE

      public static Color DB_ORANGE
    • DB_GREEN

      public static Color DB_GREEN
    • NO_FORMATTING

      public static Color NO_FORMATTING
  • Constructor Details

    • Color

      public Color(String color)
      Creates a Color instance represented by the color String. Colors are specified by name or hex value. Hex values are parsed as follows: first two digits set the Red component of the color; second two digits set the Green component; third two the Blue. Hex values must have a "#" in front, e.g. "#001122" For available names, see Color and colorNames().
      Parameters:
      color - color; may be hex representation or case-insensitive color name
      Throws:
      IllegalArgumentException - color may not be null
    • Color

      public Color(int r, int g, int b)
      Creates a Color with the specified red, green, and blue values in the range (0 - 255). Alpha is defaulted to 255.
      Parameters:
      r - the red component
      g - the green component
      b - the blue component
      Throws:
      IllegalArgumentException - if r, g or b values are outside of the range 0 to 255, inclusive
    • Color

      public Color(int r, int g, int b, int a)
      Creates a Color with the specified red, green, blue, and alpha values in the range (0 - 255). The lower the alpha, the more transparent the color.
      Parameters:
      r - the red component
      g - the green component
      b - the blue component
      a - the alpha component
      Throws:
      IllegalArgumentException - if r, g b, or a values are outside of the range 0 to 255, inclusive
    • Color

      public Color(int rgb)
      Creates a Color with the specified combined rgb value consisting of the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. Alpha is defaulted to 255.
      Parameters:
      rgb - the combined RGB components
    • Color

      public Color(int rgba, boolean hasAlpha)
      Creates a Color with the specified combined rgba value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. If hasAlpha is false, alpha is defaulted to 255.
      Parameters:
      rgba - the combined rbga components
      hasAlpha - if true, rgba is parsed with an alpha component. Otherwise, alpha defaults to 255
    • Color

      public Color(float r, float g, float b)
      Creates a Color with the specified red, green, and blue values in the range (0.0 - 1.0). Alpha is defaulted to 1.0. The lower the alpha, the more transparent the color.
      Parameters:
      r - the red component
      g - the green component
      b - the blue component
      Throws:
      IllegalArgumentException - if r, g or b values are outside of the range 0.0 to 1.0, inclusive
    • Color

      public Color(float r, float g, float b, float a)
      Creates a Color with the specified red, green, blue, and alpha values in the range (0.0 - 1.0). The lower the alpha, the more transparent the color.
      Parameters:
      r - the red component
      g - the green component
      b - the blue component
      a - the alpha component
      Throws:
      IllegalArgumentException - if r, g, b, a values are outside of the range 0.0 to 1.0, inclusive
  • Method Details

    • toHex

      public String toHex()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • color

      public static Color color(String color)
      Creates a Color instance represented by the color String. Colors are specified by name or hex value. Hex values are parsed as follows: first two digits set the Red component of the color; second two digits set the Green component; third two the Blue. Hex values must have a "#" in front, e.g. "#001122" For available names, see Color and colorNames()
      Parameters:
      color - color; may be hex representation or case-insensitive color name
      Returns:
      Color instance represented by the color String
      Throws:
      IllegalArgumentException - color may not be null
    • colorRGB

      public static Color colorRGB(int r, int g, int b)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      r - the red component in the range (0 - 255).
      g - the green component in the range (0 - 255).
      b - the blue component in the range (0 - 255).
      Returns:
      Color with the specified RGB values. Alpha is defaulted to 255.
      Throws:
      IllegalArgumentException - if r, g or b values are outside of the range 0 to 255, inclusive
    • colorRGB

      public static Color colorRGB(int r, int g, int b, int a)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      r - the red component in the range (0 - 255).
      g - the green component in the range (0 - 255).
      b - the blue component in the range (0 - 255).
      a - the alpha component in the range (0 - 255).
      Returns:
      Color with the specified RGBA values
      Throws:
      IllegalArgumentException - if r, g or b values are outside of the range 0 to 255, inclusive
    • colorRGB

      public static Color colorRGB(int rgb)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      rgb - the combined rbga components consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. Alpha is defaulted to 255.
      Returns:
      Color with the specified RGB value
    • colorRGB

      public static Color colorRGB(int rgba, boolean hasAlpha)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      rgba - the combined rbga components consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. If hasAlpha is false, alpha is set to 255.
      hasAlpha - if true, rgba is parsed with an alpha component. Otherwise, alpha defaults to 255
      Returns:
      Color with the specified RGBA value
    • colorRGB

      public static Color colorRGB(float r, float g, float b)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      r - the red component in the range (0.0 - 1.0).
      g - the green component in the range (0.0 - 1.0).
      b - the blue component in the range (0.0 - 1.0).
      Returns:
      Color with the specified RGB values. Alpha is defaulted to 1.0.
      Throws:
      IllegalArgumentException - if r, g or b values are outside of the range 0.0 to 1.0, inclusive
    • colorRGB

      public static Color colorRGB(float r, float g, float b, float a)
      Creates a Color with the specified red, green, blue, and alpha values.
      Parameters:
      r - the red component in the range (0.0 - 1.0).
      g - the green component in the range (0.0 - 1.0).
      b - the blue component in the range (0.0 - 1.0).
      a - the alpha component in the range (0.0-1.0). The lower the alpha, the more transparent the color.
      Returns:
      Color with the specified RGBA values
      Throws:
      IllegalArgumentException - if r, g, b, a values are outside of the range 0.0 to 1.0, inclusive
    • colorHSL

      public static Color colorHSL(float h, float s, float l)
      Creates a Color with the specified hue, saturation, lightness, and alpha. The lower the alpha, the more transparent the color.
      Parameters:
      h - the hue component, as a degree on the color wheel
      s - the saturation component, as a percentage
      l - the lightness component, as a percentage
      Returns:
      Color with the specified HSL values. Alpha is defaulted to 1.0.
      Throws:
      IllegalArgumentException - if s or l values are outside of the range 0.0 to 100.0, inclusive
    • colorHSL

      public static Color colorHSL(float h, float s, float l, float a)
      Creates a Color with the specified hue, saturation, lightness, and alpha. The lower the alpha, the more transparent the color.
      Parameters:
      h - the hue component, as a degree on the color wheel
      s - the saturation component, as a percentage
      l - the lightness component, as a percentage
      a - the alpha component
      Returns:
      Color with the specified HSLA values
      Throws:
      IllegalArgumentException - if s or l values are outside of the range 0.0 to 100.0, inclusive or if a is outside of the range 0.0 to 1.0, inclusive
    • colorNames

      public static String[] colorNames()
      Gets the names of all available colors.
      Returns:
      array of names of all available colors
    • javaColor

      public Color javaColor()
      Description copied from interface: Paint
      Gets the Java object representative of this Paint.
      Specified by:
      javaColor in interface Paint
      Returns:
      Java object representative of this Paint
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • valueOf

      public static Color valueOf(String color)
    • values

      public static Collection<Color> values()