Class ColorFactory


  • public final class ColorFactory
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Color ALICEBLUE
      The color alice blue with an RGB value of #F0F8FF
      static java.awt.Color ANTIQUEWHITE
      The color antique white with an RGB value of #FAEBD7
      static java.awt.Color AQUA
      The color aqua with an RGB value of #00FFFF
      static java.awt.Color AQUAMARINE
      The color aquamarine with an RGB value of #7FFFD4
      static java.awt.Color AZURE
      The color azure with an RGB value of #F0FFFF
      static java.awt.Color BEIGE
      The color beige with an RGB value of #F5F5DC
      static java.awt.Color BISQUE
      The color bisque with an RGB value of #FFE4C4
      static java.awt.Color BLACK
      The color black with an RGB value of #000000
      static java.awt.Color BLANCHEDALMOND
      The color blanched almond with an RGB value of #FFEBCD
      static java.awt.Color BLUE
      The color blue with an RGB value of #0000FF
      static java.awt.Color BLUEVIOLET
      The color blue violet with an RGB value of #8A2BE2
      static java.awt.Color BROWN
      The color brown with an RGB value of #A52A2A
      static java.awt.Color BURLYWOOD
      The color burly wood with an RGB value of #DEB887
      static java.awt.Color CADETBLUE
      The color cadet blue with an RGB value of #5F9EA0
      static java.awt.Color CHARTREUSE
      The color chartreuse with an RGB value of #7FFF00
      static java.awt.Color CHOCOLATE
      The color chocolate with an RGB value of #D2691E
      static java.awt.Color CORAL
      The color coral with an RGB value of #FF7F50
      static java.awt.Color CORNFLOWERBLUE
      The color cornflower blue with an RGB value of #6495ED
      static java.awt.Color CORNSILK
      The color cornsilk with an RGB value of #FFF8DC
      static java.awt.Color CRIMSON
      The color crimson with an RGB value of #DC143C
      static java.awt.Color CYAN
      The color cyan with an RGB value of #00FFFF
      static java.awt.Color DARKBLUE
      The color dark blue with an RGB value of #00008B
      static java.awt.Color DARKCYAN
      The color dark cyan with an RGB value of #008B8B
      static java.awt.Color DARKGOLDENROD
      The color dark goldenrod with an RGB value of #B8860B
      static java.awt.Color DARKGRAY
      The color dark gray with an RGB value of #A9A9A9
      static java.awt.Color DARKGREEN
      The color dark green with an RGB value of #006400
      static java.awt.Color DARKGREY
      The color dark grey with an RGB value of #A9A9A9
      static java.awt.Color DARKKHAKI
      The color dark khaki with an RGB value of #BDB76B
      static java.awt.Color DARKMAGENTA
      The color dark magenta with an RGB value of #8B008B
      static java.awt.Color DARKOLIVEGREEN
      The color dark olive green with an RGB value of #556B2F
      static java.awt.Color DARKORANGE
      The color dark orange with an RGB value of #FF8C00
      static java.awt.Color DARKORCHID
      The color dark orchid with an RGB value of #9932CC
      static java.awt.Color DARKRED
      The color dark red with an RGB value of #8B0000
      static java.awt.Color DARKSALMON
      The color dark salmon with an RGB value of #E9967A
      static java.awt.Color DARKSEAGREEN
      The color dark sea green with an RGB value of #8FBC8F
      static java.awt.Color DARKSLATEBLUE
      The color dark slate blue with an RGB value of #483D8B
      static java.awt.Color DARKSLATEGRAY
      The color dark slate gray with an RGB value of #2F4F4F
      static java.awt.Color DARKSLATEGREY
      The color dark slate grey with an RGB value of #2F4F4F
      static java.awt.Color DARKTURQUOISE
      The color dark turquoise with an RGB value of #00CED1
      static java.awt.Color DARKVIOLET
      The color dark violet with an RGB value of #9400D3
      static java.awt.Color DEEPPINK
      The color deep pink with an RGB value of #FF1493
      static java.awt.Color DEEPSKYBLUE
      The color deep sky blue with an RGB value of #00BFFF
      static java.awt.Color DIMGRAY
      The color dim gray with an RGB value of #696969
      static java.awt.Color DIMGREY
      The color dim grey with an RGB value of #696969
      static java.awt.Color DODGERBLUE
      The color dodger blue with an RGB value of #1E90FF
      static java.awt.Color FIREBRICK
      The color firebrick with an RGB value of #B22222
      static java.awt.Color FLORALWHITE
      The color floral white with an RGB value of #FFFAF0
      static java.awt.Color FORESTGREEN
      The color forest green with an RGB value of #228B22
      static java.awt.Color FUCHSIA
      The color fuchsia with an RGB value of #FF00FF
      static java.awt.Color GAINSBORO
      The color gainsboro with an RGB value of #DCDCDC
      static java.awt.Color GHOSTWHITE
      The color ghost white with an RGB value of #F8F8FF
      static java.awt.Color GOLD
      The color gold with an RGB value of #FFD700
      static java.awt.Color GOLDENROD
      The color goldenrod with an RGB value of #DAA520
      static java.awt.Color GRAY
      The color gray with an RGB value of #808080
      static java.awt.Color GREEN
      The color green with an RGB value of #008000
      static java.awt.Color GREENYELLOW
      The color green yellow with an RGB value of #ADFF2F
      static java.awt.Color GREY
      The color grey with an RGB value of #808080
      static java.awt.Color HONEYDEW
      The color honeydew with an RGB value of #F0FFF0
      static java.awt.Color HOTPINK
      The color hot pink with an RGB value of #FF69B4
      static java.awt.Color INDIANRED
      The color indian red with an RGB value of #CD5C5C
      static java.awt.Color INDIGO
      The color indigo with an RGB value of #4B0082
      static java.awt.Color IVORY
      The color ivory with an RGB value of #FFFFF0
      static java.awt.Color KHAKI
      The color khaki with an RGB value of #F0E68C
      static java.awt.Color LAVENDER
      The color lavender with an RGB value of #E6E6FA
      static java.awt.Color LAVENDERBLUSH
      The color lavender blush with an RGB value of #FFF0F5
      static java.awt.Color LAWNGREEN
      The color lawn green with an RGB value of #7CFC00
      static java.awt.Color LEMONCHIFFON
      The color lemon chiffon with an RGB value of #FFFACD
      static java.awt.Color LIGHTBLUE
      The color light blue with an RGB value of #ADD8E6
      static java.awt.Color LIGHTCORAL
      The color light coral with an RGB value of #F08080
      static java.awt.Color LIGHTCYAN
      The color light cyan with an RGB value of #E0FFFF
      static java.awt.Color LIGHTGOLDENRODYELLOW
      The color light goldenrod yellow with an RGB value of #FAFAD2
      static java.awt.Color LIGHTGRAY
      The color light gray with an RGB value of #D3D3D3
      static java.awt.Color LIGHTGREEN
      The color light green with an RGB value of #90EE90
      static java.awt.Color LIGHTGREY
      The color light grey with an RGB value of #D3D3D3
      static java.awt.Color LIGHTPINK
      The color light pink with an RGB value of #FFB6C1
      static java.awt.Color LIGHTSALMON
      The color light salmon with an RGB value of #FFA07A
      static java.awt.Color LIGHTSEAGREEN
      The color light sea green with an RGB value of #20B2AA
      static java.awt.Color LIGHTSKYBLUE
      The color light sky blue with an RGB value of #87CEFA
      static java.awt.Color LIGHTSLATEGRAY
      The color light slate gray with an RGB value of #778899
      static java.awt.Color LIGHTSLATEGREY
      The color light slate grey with an RGB value of #778899
      static java.awt.Color LIGHTSTEELBLUE
      The color light steel blue with an RGB value of #B0C4DE
      static java.awt.Color LIGHTYELLOW
      The color light yellow with an RGB value of #FFFFE0
      static java.awt.Color LIME
      The color lime with an RGB value of #00FF00
      static java.awt.Color LIMEGREEN
      The color lime green with an RGB value of #32CD32
      static java.awt.Color LINEN
      The color linen with an RGB value of #FAF0E6
      static java.awt.Color MAGENTA
      The color magenta with an RGB value of #FF00FF
      static java.awt.Color MAROON
      The color maroon with an RGB value of #800000
      static java.awt.Color MEDIUMAQUAMARINE
      The color medium aquamarine with an RGB value of #66CDAA
      static java.awt.Color MEDIUMBLUE
      The color medium blue with an RGB value of #0000CD
      static java.awt.Color MEDIUMORCHID
      The color medium orchid with an RGB value of #BA55D3
      static java.awt.Color MEDIUMPURPLE
      The color medium purple with an RGB value of #9370DB
      static java.awt.Color MEDIUMSEAGREEN
      The color medium sea green with an RGB value of #3CB371
      static java.awt.Color MEDIUMSLATEBLUE
      The color medium slate blue with an RGB value of #7B68EE
      static java.awt.Color MEDIUMSPRINGGREEN
      The color medium spring green with an RGB value of #00FA9A
      static java.awt.Color MEDIUMTURQUOISE
      The color medium turquoise with an RGB value of #48D1CC
      static java.awt.Color MEDIUMVIOLETRED
      The color medium violet red with an RGB value of #C71585
      static java.awt.Color MIDNIGHTBLUE
      The color midnight blue with an RGB value of #191970
      static java.awt.Color MINTCREAM
      The color mint cream with an RGB value of #F5FFFA
      static java.awt.Color MISTYROSE
      The color misty rose with an RGB value of #FFE4E1
      static java.awt.Color MOCCASIN
      The color moccasin with an RGB value of #FFE4B5
      static java.awt.Color NAVAJOWHITE
      The color navajo white with an RGB value of #FFDEAD
      static java.awt.Color NAVY
      The color navy with an RGB value of #000080
      static java.awt.Color OLDLACE
      The color old lace with an RGB value of #FDF5E6
      static java.awt.Color OLIVE
      The color olive with an RGB value of #808000
      static java.awt.Color OLIVEDRAB
      The color olive drab with an RGB value of #6B8E23
      static java.awt.Color ORANGE
      The color orange with an RGB value of #FFA500
      static java.awt.Color ORANGERED
      The color orange red with an RGB value of #FF4500
      static java.awt.Color ORCHID
      The color orchid with an RGB value of #DA70D6
      static java.awt.Color PALEGOLDENROD
      The color pale goldenrod with an RGB value of #EEE8AA
      static java.awt.Color PALEGREEN
      The color pale green with an RGB value of #98FB98
      static java.awt.Color PALETURQUOISE
      The color pale turquoise with an RGB value of #AFEEEE
      static java.awt.Color PALEVIOLETRED
      The color pale violet red with an RGB value of #DB7093
      static java.awt.Color PAPAYAWHIP
      The color papaya whip with an RGB value of #FFEFD5
      static java.awt.Color PEACHPUFF
      The color peach puff with an RGB value of #FFDAB9
      static java.awt.Color PERU
      The color peru with an RGB value of #CD853F
      static java.awt.Color PINK
      The color pink with an RGB value of #FFC0CB
      static java.awt.Color PLUM
      The color plum with an RGB value of #DDA0DD
      static java.awt.Color POWDERBLUE
      The color powder blue with an RGB value of #B0E0E6
      static java.awt.Color PURPLE
      The color purple with an RGB value of #800080
      static java.awt.Color RED
      The color red with an RGB value of #FF0000
      static java.awt.Color ROSYBROWN
      The color rosy brown with an RGB value of #BC8F8F
      static java.awt.Color ROYALBLUE
      The color royal blue with an RGB value of #4169E1
      static java.awt.Color SADDLEBROWN
      The color saddle brown with an RGB value of #8B4513
      static java.awt.Color SALMON
      The color salmon with an RGB value of #FA8072
      static java.awt.Color SANDYBROWN
      The color sandy brown with an RGB value of #F4A460
      static java.awt.Color SEAGREEN
      The color sea green with an RGB value of #2E8B57
      static java.awt.Color SEASHELL
      The color sea shell with an RGB value of #FFF5EE
      static java.awt.Color SIENNA
      The color sienna with an RGB value of #A0522D
      static java.awt.Color SILVER
      The color silver with an RGB value of #C0C0C0
      static java.awt.Color SKYBLUE
      The color sky blue with an RGB value of #87CEEB
      static java.awt.Color SLATEBLUE
      The color slate blue with an RGB value of #6A5ACD
      static java.awt.Color SLATEGRAY
      The color slate gray with an RGB value of #708090
      static java.awt.Color SLATEGREY
      The color slate grey with an RGB value of #708090
      static java.awt.Color SNOW
      The color snow with an RGB value of #FFFAFA
      static java.awt.Color SPRINGGREEN
      The color spring green with an RGB value of #00FF7F
      static java.awt.Color STEELBLUE
      The color steel blue with an RGB value of #4682B4
      static java.awt.Color TAN
      The color tan with an RGB value of #D2B48C
      static java.awt.Color TEAL
      The color teal with an RGB value of #008080
      static java.awt.Color THISTLE
      The color thistle with an RGB value of #D8BFD8
      static java.awt.Color TOMATO
      The color tomato with an RGB value of #FF6347
      static java.awt.Color TRANSPARENT
      A fully transparent color with an ARGB value of #00000000.
      static java.awt.Color TURQUOISE
      The color turquoise with an RGB value of #40E0D0
      static java.awt.Color VIOLET
      The color violet with an RGB value of #EE82EE
      static java.awt.Color WHEAT
      The color wheat with an RGB value of #F5DEB3
      static java.awt.Color WHITE
      The color white with an RGB value of #FFFFFF
      static java.awt.Color WHITESMOKE
      The color white smoke with an RGB value of #F5F5F5
      static java.awt.Color YELLOW
      The color yellow with an RGB value of #FFFF00
      static java.awt.Color YELLOWGREEN
      The color yellow green with an RGB value of #9ACD32
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.Color hsb​(double hue, double saturation, double brightness)
      Creates an opaque Color based on the specified values in the HSB color model.
      static java.awt.Color hsb​(double hue, double saturation, double brightness, double opacity)
      Creates a Color based on the specified values in the HSB color model, and a given opacity.
      static double[] HSBtoRGB​(double hue, double saturation, double brightness)  
      static double[] RGBtoHSB​(double r, double g, double b)  
      static java.awt.Color valueOf​(java.lang.String value)
      Creates a color value from a string representation.
      static java.awt.Color web​(java.lang.String colorString)
      Creates an RGB color specified with an HTML or CSS attribute string.
      static java.awt.Color web​(java.lang.String colorString, double opacity)
      Creates an RGB color specified with an HTML or CSS attribute string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TRANSPARENT

        public static final java.awt.Color TRANSPARENT
        A fully transparent color with an ARGB value of #00000000.
      • ALICEBLUE

        public static final java.awt.Color ALICEBLUE
        The color alice blue with an RGB value of #F0F8FF
      • ANTIQUEWHITE

        public static final java.awt.Color ANTIQUEWHITE
        The color antique white with an RGB value of #FAEBD7
      • AQUA

        public static final java.awt.Color AQUA
        The color aqua with an RGB value of #00FFFF
      • AQUAMARINE

        public static final java.awt.Color AQUAMARINE
        The color aquamarine with an RGB value of #7FFFD4
      • AZURE

        public static final java.awt.Color AZURE
        The color azure with an RGB value of #F0FFFF
      • BEIGE

        public static final java.awt.Color BEIGE
        The color beige with an RGB value of #F5F5DC
      • BISQUE

        public static final java.awt.Color BISQUE
        The color bisque with an RGB value of #FFE4C4
      • BLACK

        public static final java.awt.Color BLACK
        The color black with an RGB value of #000000
      • BLANCHEDALMOND

        public static final java.awt.Color BLANCHEDALMOND
        The color blanched almond with an RGB value of #FFEBCD
      • BLUE

        public static final java.awt.Color BLUE
        The color blue with an RGB value of #0000FF
      • BLUEVIOLET

        public static final java.awt.Color BLUEVIOLET
        The color blue violet with an RGB value of #8A2BE2
      • BROWN

        public static final java.awt.Color BROWN
        The color brown with an RGB value of #A52A2A
      • BURLYWOOD

        public static final java.awt.Color BURLYWOOD
        The color burly wood with an RGB value of #DEB887
      • CADETBLUE

        public static final java.awt.Color CADETBLUE
        The color cadet blue with an RGB value of #5F9EA0
      • CHARTREUSE

        public static final java.awt.Color CHARTREUSE
        The color chartreuse with an RGB value of #7FFF00
      • CHOCOLATE

        public static final java.awt.Color CHOCOLATE
        The color chocolate with an RGB value of #D2691E
      • CORAL

        public static final java.awt.Color CORAL
        The color coral with an RGB value of #FF7F50
      • CORNFLOWERBLUE

        public static final java.awt.Color CORNFLOWERBLUE
        The color cornflower blue with an RGB value of #6495ED
      • CORNSILK

        public static final java.awt.Color CORNSILK
        The color cornsilk with an RGB value of #FFF8DC
      • CRIMSON

        public static final java.awt.Color CRIMSON
        The color crimson with an RGB value of #DC143C
      • CYAN

        public static final java.awt.Color CYAN
        The color cyan with an RGB value of #00FFFF
      • DARKBLUE

        public static final java.awt.Color DARKBLUE
        The color dark blue with an RGB value of #00008B
      • DARKCYAN

        public static final java.awt.Color DARKCYAN
        The color dark cyan with an RGB value of #008B8B
      • DARKGOLDENROD

        public static final java.awt.Color DARKGOLDENROD
        The color dark goldenrod with an RGB value of #B8860B
      • DARKGRAY

        public static final java.awt.Color DARKGRAY
        The color dark gray with an RGB value of #A9A9A9
      • DARKGREEN

        public static final java.awt.Color DARKGREEN
        The color dark green with an RGB value of #006400
      • DARKGREY

        public static final java.awt.Color DARKGREY
        The color dark grey with an RGB value of #A9A9A9
      • DARKKHAKI

        public static final java.awt.Color DARKKHAKI
        The color dark khaki with an RGB value of #BDB76B
      • DARKMAGENTA

        public static final java.awt.Color DARKMAGENTA
        The color dark magenta with an RGB value of #8B008B
      • DARKOLIVEGREEN

        public static final java.awt.Color DARKOLIVEGREEN
        The color dark olive green with an RGB value of #556B2F
      • DARKORANGE

        public static final java.awt.Color DARKORANGE
        The color dark orange with an RGB value of #FF8C00
      • DARKORCHID

        public static final java.awt.Color DARKORCHID
        The color dark orchid with an RGB value of #9932CC
      • DARKRED

        public static final java.awt.Color DARKRED
        The color dark red with an RGB value of #8B0000
      • DARKSALMON

        public static final java.awt.Color DARKSALMON
        The color dark salmon with an RGB value of #E9967A
      • DARKSEAGREEN

        public static final java.awt.Color DARKSEAGREEN
        The color dark sea green with an RGB value of #8FBC8F
      • DARKSLATEBLUE

        public static final java.awt.Color DARKSLATEBLUE
        The color dark slate blue with an RGB value of #483D8B
      • DARKSLATEGRAY

        public static final java.awt.Color DARKSLATEGRAY
        The color dark slate gray with an RGB value of #2F4F4F
      • DARKSLATEGREY

        public static final java.awt.Color DARKSLATEGREY
        The color dark slate grey with an RGB value of #2F4F4F
      • DARKTURQUOISE

        public static final java.awt.Color DARKTURQUOISE
        The color dark turquoise with an RGB value of #00CED1
      • DARKVIOLET

        public static final java.awt.Color DARKVIOLET
        The color dark violet with an RGB value of #9400D3
      • DEEPPINK

        public static final java.awt.Color DEEPPINK
        The color deep pink with an RGB value of #FF1493
      • DEEPSKYBLUE

        public static final java.awt.Color DEEPSKYBLUE
        The color deep sky blue with an RGB value of #00BFFF
      • DIMGRAY

        public static final java.awt.Color DIMGRAY
        The color dim gray with an RGB value of #696969
      • DIMGREY

        public static final java.awt.Color DIMGREY
        The color dim grey with an RGB value of #696969
      • DODGERBLUE

        public static final java.awt.Color DODGERBLUE
        The color dodger blue with an RGB value of #1E90FF
      • FIREBRICK

        public static final java.awt.Color FIREBRICK
        The color firebrick with an RGB value of #B22222
      • FLORALWHITE

        public static final java.awt.Color FLORALWHITE
        The color floral white with an RGB value of #FFFAF0
      • FORESTGREEN

        public static final java.awt.Color FORESTGREEN
        The color forest green with an RGB value of #228B22
      • FUCHSIA

        public static final java.awt.Color FUCHSIA
        The color fuchsia with an RGB value of #FF00FF
      • GAINSBORO

        public static final java.awt.Color GAINSBORO
        The color gainsboro with an RGB value of #DCDCDC
      • GHOSTWHITE

        public static final java.awt.Color GHOSTWHITE
        The color ghost white with an RGB value of #F8F8FF
      • GOLD

        public static final java.awt.Color GOLD
        The color gold with an RGB value of #FFD700
      • GOLDENROD

        public static final java.awt.Color GOLDENROD
        The color goldenrod with an RGB value of #DAA520
      • GRAY

        public static final java.awt.Color GRAY
        The color gray with an RGB value of #808080
      • GREEN

        public static final java.awt.Color GREEN
        The color green with an RGB value of #008000
      • GREENYELLOW

        public static final java.awt.Color GREENYELLOW
        The color green yellow with an RGB value of #ADFF2F
      • GREY

        public static final java.awt.Color GREY
        The color grey with an RGB value of #808080
      • HONEYDEW

        public static final java.awt.Color HONEYDEW
        The color honeydew with an RGB value of #F0FFF0
      • HOTPINK

        public static final java.awt.Color HOTPINK
        The color hot pink with an RGB value of #FF69B4
      • INDIANRED

        public static final java.awt.Color INDIANRED
        The color indian red with an RGB value of #CD5C5C
      • INDIGO

        public static final java.awt.Color INDIGO
        The color indigo with an RGB value of #4B0082
      • IVORY

        public static final java.awt.Color IVORY
        The color ivory with an RGB value of #FFFFF0
      • KHAKI

        public static final java.awt.Color KHAKI
        The color khaki with an RGB value of #F0E68C
      • LAVENDER

        public static final java.awt.Color LAVENDER
        The color lavender with an RGB value of #E6E6FA
      • LAVENDERBLUSH

        public static final java.awt.Color LAVENDERBLUSH
        The color lavender blush with an RGB value of #FFF0F5
      • LAWNGREEN

        public static final java.awt.Color LAWNGREEN
        The color lawn green with an RGB value of #7CFC00
      • LEMONCHIFFON

        public static final java.awt.Color LEMONCHIFFON
        The color lemon chiffon with an RGB value of #FFFACD
      • LIGHTBLUE

        public static final java.awt.Color LIGHTBLUE
        The color light blue with an RGB value of #ADD8E6
      • LIGHTCORAL

        public static final java.awt.Color LIGHTCORAL
        The color light coral with an RGB value of #F08080
      • LIGHTCYAN

        public static final java.awt.Color LIGHTCYAN
        The color light cyan with an RGB value of #E0FFFF
      • LIGHTGOLDENRODYELLOW

        public static final java.awt.Color LIGHTGOLDENRODYELLOW
        The color light goldenrod yellow with an RGB value of #FAFAD2
      • LIGHTGRAY

        public static final java.awt.Color LIGHTGRAY
        The color light gray with an RGB value of #D3D3D3
      • LIGHTGREEN

        public static final java.awt.Color LIGHTGREEN
        The color light green with an RGB value of #90EE90
      • LIGHTGREY

        public static final java.awt.Color LIGHTGREY
        The color light grey with an RGB value of #D3D3D3
      • LIGHTPINK

        public static final java.awt.Color LIGHTPINK
        The color light pink with an RGB value of #FFB6C1
      • LIGHTSALMON

        public static final java.awt.Color LIGHTSALMON
        The color light salmon with an RGB value of #FFA07A
      • LIGHTSEAGREEN

        public static final java.awt.Color LIGHTSEAGREEN
        The color light sea green with an RGB value of #20B2AA
      • LIGHTSKYBLUE

        public static final java.awt.Color LIGHTSKYBLUE
        The color light sky blue with an RGB value of #87CEFA
      • LIGHTSLATEGRAY

        public static final java.awt.Color LIGHTSLATEGRAY
        The color light slate gray with an RGB value of #778899
      • LIGHTSLATEGREY

        public static final java.awt.Color LIGHTSLATEGREY
        The color light slate grey with an RGB value of #778899
      • LIGHTSTEELBLUE

        public static final java.awt.Color LIGHTSTEELBLUE
        The color light steel blue with an RGB value of #B0C4DE
      • LIGHTYELLOW

        public static final java.awt.Color LIGHTYELLOW
        The color light yellow with an RGB value of #FFFFE0
      • LIME

        public static final java.awt.Color LIME
        The color lime with an RGB value of #00FF00
      • LIMEGREEN

        public static final java.awt.Color LIMEGREEN
        The color lime green with an RGB value of #32CD32
      • LINEN

        public static final java.awt.Color LINEN
        The color linen with an RGB value of #FAF0E6
      • MAGENTA

        public static final java.awt.Color MAGENTA
        The color magenta with an RGB value of #FF00FF
      • MAROON

        public static final java.awt.Color MAROON
        The color maroon with an RGB value of #800000
      • MEDIUMAQUAMARINE

        public static final java.awt.Color MEDIUMAQUAMARINE
        The color medium aquamarine with an RGB value of #66CDAA
      • MEDIUMBLUE

        public static final java.awt.Color MEDIUMBLUE
        The color medium blue with an RGB value of #0000CD
      • MEDIUMORCHID

        public static final java.awt.Color MEDIUMORCHID
        The color medium orchid with an RGB value of #BA55D3
      • MEDIUMPURPLE

        public static final java.awt.Color MEDIUMPURPLE
        The color medium purple with an RGB value of #9370DB
      • MEDIUMSEAGREEN

        public static final java.awt.Color MEDIUMSEAGREEN
        The color medium sea green with an RGB value of #3CB371
      • MEDIUMSLATEBLUE

        public static final java.awt.Color MEDIUMSLATEBLUE
        The color medium slate blue with an RGB value of #7B68EE
      • MEDIUMSPRINGGREEN

        public static final java.awt.Color MEDIUMSPRINGGREEN
        The color medium spring green with an RGB value of #00FA9A
      • MEDIUMTURQUOISE

        public static final java.awt.Color MEDIUMTURQUOISE
        The color medium turquoise with an RGB value of #48D1CC
      • MEDIUMVIOLETRED

        public static final java.awt.Color MEDIUMVIOLETRED
        The color medium violet red with an RGB value of #C71585
      • MIDNIGHTBLUE

        public static final java.awt.Color MIDNIGHTBLUE
        The color midnight blue with an RGB value of #191970
      • MINTCREAM

        public static final java.awt.Color MINTCREAM
        The color mint cream with an RGB value of #F5FFFA
      • MISTYROSE

        public static final java.awt.Color MISTYROSE
        The color misty rose with an RGB value of #FFE4E1
      • MOCCASIN

        public static final java.awt.Color MOCCASIN
        The color moccasin with an RGB value of #FFE4B5
      • NAVAJOWHITE

        public static final java.awt.Color NAVAJOWHITE
        The color navajo white with an RGB value of #FFDEAD
      • NAVY

        public static final java.awt.Color NAVY
        The color navy with an RGB value of #000080
      • OLDLACE

        public static final java.awt.Color OLDLACE
        The color old lace with an RGB value of #FDF5E6
      • OLIVE

        public static final java.awt.Color OLIVE
        The color olive with an RGB value of #808000
      • OLIVEDRAB

        public static final java.awt.Color OLIVEDRAB
        The color olive drab with an RGB value of #6B8E23
      • ORANGE

        public static final java.awt.Color ORANGE
        The color orange with an RGB value of #FFA500
      • ORANGERED

        public static final java.awt.Color ORANGERED
        The color orange red with an RGB value of #FF4500
      • ORCHID

        public static final java.awt.Color ORCHID
        The color orchid with an RGB value of #DA70D6
      • PALEGOLDENROD

        public static final java.awt.Color PALEGOLDENROD
        The color pale goldenrod with an RGB value of #EEE8AA
      • PALEGREEN

        public static final java.awt.Color PALEGREEN
        The color pale green with an RGB value of #98FB98
      • PALETURQUOISE

        public static final java.awt.Color PALETURQUOISE
        The color pale turquoise with an RGB value of #AFEEEE
      • PALEVIOLETRED

        public static final java.awt.Color PALEVIOLETRED
        The color pale violet red with an RGB value of #DB7093
      • PAPAYAWHIP

        public static final java.awt.Color PAPAYAWHIP
        The color papaya whip with an RGB value of #FFEFD5
      • PEACHPUFF

        public static final java.awt.Color PEACHPUFF
        The color peach puff with an RGB value of #FFDAB9
      • PERU

        public static final java.awt.Color PERU
        The color peru with an RGB value of #CD853F
      • PINK

        public static final java.awt.Color PINK
        The color pink with an RGB value of #FFC0CB
      • PLUM

        public static final java.awt.Color PLUM
        The color plum with an RGB value of #DDA0DD
      • POWDERBLUE

        public static final java.awt.Color POWDERBLUE
        The color powder blue with an RGB value of #B0E0E6
      • PURPLE

        public static final java.awt.Color PURPLE
        The color purple with an RGB value of #800080
      • RED

        public static final java.awt.Color RED
        The color red with an RGB value of #FF0000
      • ROSYBROWN

        public static final java.awt.Color ROSYBROWN
        The color rosy brown with an RGB value of #BC8F8F
      • ROYALBLUE

        public static final java.awt.Color ROYALBLUE
        The color royal blue with an RGB value of #4169E1
      • SADDLEBROWN

        public static final java.awt.Color SADDLEBROWN
        The color saddle brown with an RGB value of #8B4513
      • SALMON

        public static final java.awt.Color SALMON
        The color salmon with an RGB value of #FA8072
      • SANDYBROWN

        public static final java.awt.Color SANDYBROWN
        The color sandy brown with an RGB value of #F4A460
      • SEAGREEN

        public static final java.awt.Color SEAGREEN
        The color sea green with an RGB value of #2E8B57
      • SEASHELL

        public static final java.awt.Color SEASHELL
        The color sea shell with an RGB value of #FFF5EE
      • SIENNA

        public static final java.awt.Color SIENNA
        The color sienna with an RGB value of #A0522D
      • SILVER

        public static final java.awt.Color SILVER
        The color silver with an RGB value of #C0C0C0
      • SKYBLUE

        public static final java.awt.Color SKYBLUE
        The color sky blue with an RGB value of #87CEEB
      • SLATEBLUE

        public static final java.awt.Color SLATEBLUE
        The color slate blue with an RGB value of #6A5ACD
      • SLATEGRAY

        public static final java.awt.Color SLATEGRAY
        The color slate gray with an RGB value of #708090
      • SLATEGREY

        public static final java.awt.Color SLATEGREY
        The color slate grey with an RGB value of #708090
      • SNOW

        public static final java.awt.Color SNOW
        The color snow with an RGB value of #FFFAFA
      • SPRINGGREEN

        public static final java.awt.Color SPRINGGREEN
        The color spring green with an RGB value of #00FF7F
      • STEELBLUE

        public static final java.awt.Color STEELBLUE
        The color steel blue with an RGB value of #4682B4
      • TAN

        public static final java.awt.Color TAN
        The color tan with an RGB value of #D2B48C
      • TEAL

        public static final java.awt.Color TEAL
        The color teal with an RGB value of #008080
      • THISTLE

        public static final java.awt.Color THISTLE
        The color thistle with an RGB value of #D8BFD8
      • TOMATO

        public static final java.awt.Color TOMATO
        The color tomato with an RGB value of #FF6347
      • TURQUOISE

        public static final java.awt.Color TURQUOISE
        The color turquoise with an RGB value of #40E0D0
      • VIOLET

        public static final java.awt.Color VIOLET
        The color violet with an RGB value of #EE82EE
      • WHEAT

        public static final java.awt.Color WHEAT
        The color wheat with an RGB value of #F5DEB3
      • WHITE

        public static final java.awt.Color WHITE
        The color white with an RGB value of #FFFFFF
      • WHITESMOKE

        public static final java.awt.Color WHITESMOKE
        The color white smoke with an RGB value of #F5F5F5
      • YELLOW

        public static final java.awt.Color YELLOW
        The color yellow with an RGB value of #FFFF00
      • YELLOWGREEN

        public static final java.awt.Color YELLOWGREEN
        The color yellow green with an RGB value of #9ACD32
    • Constructor Detail

      • ColorFactory

        public ColorFactory()
    • Method Detail

      • hsb

        public static java.awt.Color hsb​(double hue,
                                         double saturation,
                                         double brightness,
                                         double opacity)
        Creates a Color based on the specified values in the HSB color model, and a given opacity.
        Parameters:
        hue - the hue, in degrees
        saturation - the saturation, 0.0 to 1.0
        brightness - the brightness, 0.0 to 1.0
        opacity - the opacity, 0.0 to 1.0
        Returns:
        the Color
        Throws:
        java.lang.IllegalArgumentException - if saturation, brightness or opacity are out of range
      • hsb

        public static java.awt.Color hsb​(double hue,
                                         double saturation,
                                         double brightness)
        Creates an opaque Color based on the specified values in the HSB color model.
        Parameters:
        hue - the hue, in degrees
        saturation - the saturation, 0.0 to 1.0
        brightness - the brightness, 0.0 to 1.0
        Returns:
        the Color
        Throws:
        java.lang.IllegalArgumentException - if saturation or brightness are out of range
      • web

        public static java.awt.Color web​(java.lang.String colorString,
                                         double opacity)
        Creates an RGB color specified with an HTML or CSS attribute string.

        This method supports the following formats:

        • Any standard HTML color name
        • An HTML long or short format hex string with an optional hex alpha channel. Hexadecimal values may be preceded by either "0x" or "#" and can either be 2 digits in the range 00 to 0xFF or a single digit in the range 0 to F.
        • An rgb(r,g,b) or rgba(r,g,b,a) format string. Each of the r, g, or b values can be an integer from 0 to 255 or a floating point percentage value from 0.0 to 100.0 followed by the percent (%) character. The alpha component, if present, is a floating point value from 0.0 to 1.0. Spaces are allowed before or after the numbers and between the percentage number and its percent sign (%).
        • An hsl(h,s,l) or hsla(h,s,l,a) format string. The h value is a floating point number from 0.0 to 360.0 representing the hue angle on a color wheel in degrees with 0.0 or 360.0 representing red, 120.0 representing green, and 240.0 representing blue. The s value is the saturation of the desired color represented as a floating point percentage from gray (0.0) to the fully saturated color (100.0) and the l value is the desired lightness or brightness of the desired color represented as a floating point percentage from black (0.0) to the full brightness of the color (100.0). The alpha component, if present, is a floating point value from 0.0 to 1.0. Spaces are allowed before or after the numbers and between the percentage number and its percent sign (%).

        For formats without an alpha component and for named colors, opacity is set according to the opacity argument. For colors specified with an alpha component, the resulting opacity is a combination of the parsed alpha component and the opacity argument, so a transparent color becomes more transparent by specifying opacity.

        Examples:

        Web Color Format Table
        Web Format String Equivalent constructor or factory call
        Color.web("orange", 0.5); new Color(1.0, 0xA5/255.0, 0.0, 0.5)
        Color.web("0xff66cc33", 0.5); new Color(1.0, 0.4, 0.8, 0.1)
        Color.web("0xff66cc", 0.5); new Color(1.0, 0.4, 0.8, 0.5)
        Color.web("#ff66cc", 0.5); new Color(1.0, 0.4, 0.8, 0.5)
        Color.web("#f68", 0.5); new Color(1.0, 0.4, 0.8, 0.5)
        Color.web("rgb(255,102,204)", 0.5); new Color(1.0, 0.4, 0.8, 0.5)
        Color.web("rgb(100%,50%,50%)", 0.5); new Color(1.0, 0.5, 0.5, 0.5)
        Color.web("rgb(255,50%,50%,0.25)", 0.5); new Color(1.0, 0.5, 0.5, 0.125)
        Color.web("hsl(240,100%,100%)", 0.5); Color.hsb(240.0, 1.0, 1.0, 0.5)
        Color.web("hsla(120,0%,0%,0.25)", 0.5); Color.hsb(120.0, 0.0, 0.0, 0.125)
        Parameters:
        colorString - the name or numeric representation of the color in one of the supported formats
        opacity - the opacity component in range from 0.0 (transparent) to 1.0 (opaque)
        Returns:
        the RGB color specified with the colorString
        Throws:
        java.lang.NullPointerException - if colorString is null
        java.lang.IllegalArgumentException - if colorString specifies an unsupported color name or contains an illegal numeric value
      • web

        public static java.awt.Color web​(java.lang.String colorString)
        Creates an RGB color specified with an HTML or CSS attribute string.

        This method supports the following formats:

        • Any standard HTML color name
        • An HTML long or short format hex string with an optional hex alpha channel. Hexadecimal values may be preceded by either "0x" or "#" and can either be 2 digits in the range 00 to 0xFF or a single digit in the range 0 to F.
        • An rgb(r,g,b) or rgba(r,g,b,a) format string. Each of the r, g, or b values can be an integer from 0 to 255 or a floating point percentage value from 0.0 to 100.0 followed by the percent (%) character. The alpha component, if present, is a floating point value from 0.0 to 1.0. Spaces are allowed before or after the numbers and between the percentage number and its percent sign (%).
        • An hsl(h,s,l) or hsla(h,s,l,a) format string. The h value is a floating point number from 0.0 to 360.0 representing the hue angle on a color wheel in degrees with 0.0 or 360.0 representing red, 120.0 representing green, and 240.0 representing blue. The s value is the saturation of the desired color represented as a floating point percentage from gray (0.0) to the fully saturated color (100.0) and the l value is the desired lightness or brightness of the desired color represented as a floating point percentage from black (0.0) to the full brightness of the color (100.0). The alpha component, if present, is a floating point value from 0.0 to 1.0. Spaces are allowed before or after the numbers and between the percentage number and its percent sign (%).

        Examples:

        Web Color Format Table
        Web Format String Equivalent constant or factory call
        Color.web("orange"); Color.ORANGE
        Color.web("0xff668840"); Color.rgb(255, 102, 136, 0.25)
        Color.web("0xff6688"); Color.rgb(255, 102, 136, 1.0)
        Color.web("#ff6688"); Color.rgb(255, 102, 136, 1.0)
        Color.web("#f68"); Color.rgb(255, 102, 136, 1.0)
        Color.web("rgb(255,102,136)"); Color.rgb(255, 102, 136, 1.0)
        Color.web("rgb(100%,50%,50%)"); Color.rgb(255, 128, 128, 1.0)
        Color.web("rgb(255,50%,50%,0.25)"); Color.rgb(255, 128, 128, 0.25)
        Color.web("hsl(240,100%,100%)"); Color.hsb(240.0, 1.0, 1.0, 1.0)
        Color.web("hsla(120,0%,0%,0.25)"); Color.hsb(120.0, 0.0, 0.0, 0.25)
        Parameters:
        colorString - the name or numeric representation of the color in one of the supported formats
        Returns:
        an RGB color
        Throws:
        java.lang.NullPointerException - if colorString is null
        java.lang.IllegalArgumentException - if colorString specifies an unsupported color name or contains an illegal numeric value
      • valueOf

        public static java.awt.Color valueOf​(java.lang.String value)
        Creates a color value from a string representation. The format of the string representation is the same as in web(String).
        Parameters:
        value - the string to convert
        Returns:
        a Color object holding the value represented by the string argument
        Throws:
        java.lang.NullPointerException - if the value is null
        java.lang.IllegalArgumentException - if the value specifies an unsupported color name or illegal hexadecimal value
        See Also:
        web(String)
      • HSBtoRGB

        public static double[] HSBtoRGB​(double hue,
                                        double saturation,
                                        double brightness)
      • RGBtoHSB

        public static double[] RGBtoHSB​(double r,
                                        double g,
                                        double b)