Package codedraw
Class Palette
java.lang.Object
codedraw.Palette
Palette provides a wide variety of colors and makes it easier to create colors.
Alternatively you can just use awt
Color
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
static final Color
-
Method Summary
Modifier and TypeMethodDescriptionstatic Color
fromBaseColor
(Color baseColor, int alpha) Creates a new Color based of the baseColor but with a different alpha value.static Color
fromGrayscale
(int gray) Creates a grayscale color where its color component (red, green, blue) all have the same value.static Color
fromRGB
(int rgb) Creates an rgba color with the alpha implicitly being 255.static Color
fromRGB
(int red, int green, int blue) Creates an rgba color with the alpha implicitly being 255.static Color
fromRGBA
(int rgba) Creates an rgba color.static Color
fromRGBA
(int red, int green, int blue, int alpha) Creates an rgba color.static Color
Generates a random color.
-
Field Details
-
BLACK
-
NAVY
-
DARK_BLUE
-
MEDIUM_BLUE
-
BLUE
-
DARK_GREEN
-
GREEN
-
TEAL
-
DARK_CYAN
-
DEEP_SKY_BLUE
-
DARK_TURQUOISE
-
MEDIUM_SPRING_GREEN
-
LIME
-
SPRING_GREEN
-
AQUA
-
CYAN
-
MIDNIGHT_BLUE
-
DODGER_BLUE
-
LIGHT_SEA_GREEN
-
FOREST_GREEN
-
SEA_GREEN
-
DARK_SLATE_GRAY
-
DARK_SLATE_GREY
-
LIME_GREEN
-
MEDIUM_SEA_GREEN
-
TURQUOISE
-
ROYAL_BLUE
-
STEEL_BLUE
-
DARK_SLATE_BLUE
-
MEDIUM_TURQUOISE
-
INDIGO
-
DARK_OLIVE_GREEN
-
CADET_BLUE
-
CORNFLOWER_BLUE
-
REBECCA_PURPLE
-
MEDIUM_AQUA_MARINE
-
DIM_GRAY
-
DIM_GREY
-
SLATE_BLUE
-
OLIVE_DRAB
-
SLATE_GRAY
-
SLATE_GREY
-
LIGHT_SLATE_GRAY
-
LIGHT_SLATE_GREY
-
MEDIUM_SLATE_BLUE
-
LAWN_GREEN
-
CHARTREUSE
-
AQUAMARINE
-
MAROON
-
PURPLE
-
OLIVE
-
GRAY
-
GREY
-
SKY_BLUE
-
LIGHT_SKY_BLUE
-
BLUE_VIOLET
-
DARK_RED
-
DARK_MAGENTA
-
SADDLE_BROWN
-
DARK_SEA_GREEN
-
LIGHT_GREEN
-
MEDIUM_PURPLE
-
DARK_VIOLET
-
PALE_GREEN
-
DARK_ORCHID
-
YELLOW_GREEN
-
SIENNA
-
BROWN
-
DARK_GRAY
-
DARK_GREY
-
LIGHT_BLUE
-
GREEN_YELLOW
-
PALE_TURQUOISE
-
LIGHT_STEEL_BLUE
-
POWDER_BLUE
-
FIRE_BRICK
-
DARK_GOLDEN_ROD
-
MEDIUM_ORCHID
-
ROSY_BROWN
-
DARK_KHAKI
-
SILVER
-
MEDIUM_VIOLET_RED
-
INDIAN_RED
-
PERU
-
CHOCOLATE
-
TAN
-
LIGHT_GRAY
-
LIGHT_GREY
-
THISTLE
-
ORCHID
-
GOLDEN_ROD
-
PALE_VIOLET_RED
-
CRIMSON
-
GAINSBORO
-
PLUM
-
BURLY_WOOD
-
LIGHT_CYAN
-
LAVENDER
-
DARK_SALMON
-
VIOLET
-
PALE_GOLDEN_ROD
-
LIGHT_CORAL
-
KHAKI
-
ALICE_BLUE
-
HONEY_DEW
-
AZURE
-
SANDY_BROWN
-
WHEAT
-
BEIGE
-
WHITE_SMOKE
-
MINT_CREAM
-
GHOST_WHITE
-
SALMON
-
ANTIQUE_WHITE
-
LINEN
-
LIGHT_GOLDEN_ROD_YELLOW
-
OLD_LACE
-
RED
-
FUCHSIA
-
MAGENTA
-
DEEP_PINK
-
ORANGE_RED
-
TOMATO
-
HOT_PINK
-
CORAL
-
DARK_ORANGE
-
LIGHT_SALMON
-
ORANGE
-
LIGHT_PINK
-
PINK
-
GOLD
-
PEACH_PUFF
-
NAVAJO_WHITE
-
MOCCASIN
-
BISQUE
-
MISTY_ROSE
-
BLANCHED_ALMOND
-
PAPAYA_WHIP
-
LAVENDER_BLUSH
-
SEA_SHELL
-
CORNSILK
-
LEMON_CHIFFON
-
FLORAL_WHITE
-
SNOW
-
YELLOW
-
LIGHT_YELLOW
-
IVORY
-
WHITE
-
-
Method Details
-
randomColor
Generates a random color. The color will not be transparent.- Returns:
- a random color.
-
fromGrayscale
Creates a grayscale color where its color component (red, green, blue) all have the same value. 0 is white. 255 is black. 128 would be gray.- Parameters:
gray
- The value can range from 0 to 255.
-
fromRGB
Creates an rgba color with the alpha implicitly being 255. The 8 most significant bits are ignored. The following 24 bits represent the red, green and blue amount of the color (8 bits each). For example Palette.fromRGB(0xFF00FF) would produce a pink color because both red and blue are set to 255.- Parameters:
rgb
- The value can range from 0 to 16777216 (0xFFFFFF in hexadecimal)
-
fromRGB
Creates an rgba color with the alpha implicitly being 255. 0 is no color. 255 is maximum color.- Parameters:
red
- The value can range from 0 to 255.green
- The value can range from 0 to 255.blue
- The value can range from 0 to 255.
-
fromRGBA
Creates an rgba color. The 8 most significant bits represent red. The following 8 bits represent green. The next 8 bits represent blue . The 8 least significant bits represent the alpha value. For example Palette.fromRGBA(0xFF00FF80) would produce a pink color that is 50% transparent because both red and blue are set to 255 and the alpha value is 128.- Parameters:
rgba
- any valid integer value.
-
fromBaseColor
Creates a new Color based of the baseColor but with a different alpha value.- Parameters:
baseColor
- Any color. It's alpha value will be ignored when creating the new color.alpha
- The value can range from 0 to 255
-
fromRGBA
Creates an rgba color. 0 is no color. 255 is maximum color.- Parameters:
red
- The value can range from 0 to 255.green
- The value can range from 0 to 255.blue
- The value can range from 0 to 255.alpha
- The value can range from 0 to 255. 0 is invisible. 255 is 100% visible.
-