Class Color

java.lang.Object
com.jbstrap.ui.bootstrap.Color
All Implemented Interfaces:
StyleElement

public final class Color extends Object implements StyleElement
Colors
Since:
4.0
Author:
JBStrap
  • Field Details

    • PRIMARY

      public static final Color PRIMARY
    • SECONDARY

      public static final Color SECONDARY
    • SUCCESS

      public static final Color SUCCESS
    • DANGER

      public static final Color DANGER
    • WARNING

      public static final Color WARNING
    • INFO

      public static final Color INFO
    • LIGHT

      public static final Color LIGHT
    • DARK

      public static final Color DARK
    • WHITE

      public static final Color WHITE
    • MUTED

      public static final Color MUTED
    • BLACK_50

      public static final Color BLACK_50
    • WHITE_50

      public static final Color WHITE_50
    • BODY

      public static final Color BODY
    • TRANSPARENT

      public static final Color TRANSPARENT
    • ALICE_BLUE

      public static final Color ALICE_BLUE
    • ANTIQUE_WHITE

      public static final Color ANTIQUE_WHITE
    • AQUA

      public static final Color AQUA
    • AQUAMARINE

      public static final Color AQUAMARINE
    • AZURE

      public static final Color AZURE
    • BEIGE

      public static final Color BEIGE
    • BISQUE

      public static final Color BISQUE
    • CSS_BLACK

      public static final Color CSS_BLACK
    • BLANCHED_ALMOND

      public static final Color BLANCHED_ALMOND
    • BLUE

      public static final Color BLUE
    • BLUE_VIOLET

      public static final Color BLUE_VIOLET
    • BROWN

      public static final Color BROWN
    • BURLY_WOOD

      public static final Color BURLY_WOOD
    • CADET_BLUE

      public static final Color CADET_BLUE
    • CHARTREUSE

      public static final Color CHARTREUSE
    • CHOCOLATE

      public static final Color CHOCOLATE
    • CORAL

      public static final Color CORAL
    • CORNFLOWER_BLUE

      public static final Color CORNFLOWER_BLUE
    • CORNSILK

      public static final Color CORNSILK
    • CRIMSON

      public static final Color CRIMSON
    • CYAN

      public static final Color CYAN
    • DARK_BLUE

      public static final Color DARK_BLUE
    • DARK_CYAN

      public static final Color DARK_CYAN
    • DARK_GOLDEN_ROD

      public static final Color DARK_GOLDEN_ROD
    • DARK_GRAY

      public static final Color DARK_GRAY
    • DARK_GREY

      public static final Color DARK_GREY
    • DARK_GREEN

      public static final Color DARK_GREEN
    • DARK_KHAKI

      public static final Color DARK_KHAKI
    • DARK_MAGENTA

      public static final Color DARK_MAGENTA
    • DARK_OLIVE_GREEN

      public static final Color DARK_OLIVE_GREEN
    • DARK_ORANGE

      public static final Color DARK_ORANGE
    • DARK_ORCHID

      public static final Color DARK_ORCHID
    • DARK_RED

      public static final Color DARK_RED
    • DARK_SALMON

      public static final Color DARK_SALMON
    • DARK_SEA_GREEN

      public static final Color DARK_SEA_GREEN
    • DARK_SLATE_BLUE

      public static final Color DARK_SLATE_BLUE
    • DARK_SLATE_GRAY

      public static final Color DARK_SLATE_GRAY
    • DARK_SLATE_GREY

      public static final Color DARK_SLATE_GREY
    • DARK_TURQUOISE

      public static final Color DARK_TURQUOISE
    • DARK_VIOLET

      public static final Color DARK_VIOLET
    • DEEP_PINK

      public static final Color DEEP_PINK
    • DEEP_SKY_BLUE

      public static final Color DEEP_SKY_BLUE
    • DIM_GRAY

      public static final Color DIM_GRAY
    • DIM_GREY

      public static final Color DIM_GREY
    • DODGER_BLUE

      public static final Color DODGER_BLUE
    • FIRE_BRICK

      public static final Color FIRE_BRICK
    • FLORAL_WHITE

      public static final Color FLORAL_WHITE
    • FOREST_GREEN

      public static final Color FOREST_GREEN
    • FUCHSIA

      public static final Color FUCHSIA
    • GAINSBORO

      public static final Color GAINSBORO
    • GHOST_WHITE

      public static final Color GHOST_WHITE
    • GOLD

      public static final Color GOLD
    • GOLDEN_ROD

      public static final Color GOLDEN_ROD
    • GRAY

      public static final Color GRAY
    • GREY

      public static final Color GREY
    • GREEN

      public static final Color GREEN
    • GREEN_YELLOW

      public static final Color GREEN_YELLOW
    • HONEY_DEW

      public static final Color HONEY_DEW
    • HOT_PINK

      public static final Color HOT_PINK
    • INDIAN_RED

      public static final Color INDIAN_RED
    • INDIGO

      public static final Color INDIGO
    • IVORY

      public static final Color IVORY
    • KHAKI

      public static final Color KHAKI
    • LAVENDER

      public static final Color LAVENDER
    • LAVENDER_BLUSH

      public static final Color LAVENDER_BLUSH
    • LAWN_GREEN

      public static final Color LAWN_GREEN
    • LEMON_CHIFFON

      public static final Color LEMON_CHIFFON
    • LIGHT_BLUE

      public static final Color LIGHT_BLUE
    • LIGHT_CORAL

      public static final Color LIGHT_CORAL
    • LIGHT_CYAN

      public static final Color LIGHT_CYAN
    • LIGHT_GOLDEN_ROD_YELLOW

      public static final Color LIGHT_GOLDEN_ROD_YELLOW
    • LIGHT_GRAY

      public static final Color LIGHT_GRAY
    • LIGHT_GREY

      public static final Color LIGHT_GREY
    • LIGHT_GREEN

      public static final Color LIGHT_GREEN
    • LIGHT_PINK

      public static final Color LIGHT_PINK
    • LIGHT_SALMON

      public static final Color LIGHT_SALMON
    • LIGHT_SEA_GREEN

      public static final Color LIGHT_SEA_GREEN
    • LIGHT_SKY_BLUE

      public static final Color LIGHT_SKY_BLUE
    • LIGHT_SLATE_GRAY

      public static final Color LIGHT_SLATE_GRAY
    • LIGHT_SLATE_GREY

      public static final Color LIGHT_SLATE_GREY
    • LIGHT_STEEL_BLUE

      public static final Color LIGHT_STEEL_BLUE
    • LIGHT_YELLOW

      public static final Color LIGHT_YELLOW
    • LIME

      public static final Color LIME
    • LIME_GREEN

      public static final Color LIME_GREEN
    • LINEN

      public static final Color LINEN
    • MAGENTA

      public static final Color MAGENTA
    • MAROON

      public static final Color MAROON
    • MEDIUM_AQUA_MARINE

      public static final Color MEDIUM_AQUA_MARINE
    • MEDIUM_BLUE

      public static final Color MEDIUM_BLUE
    • MEDIUM_ORCHID

      public static final Color MEDIUM_ORCHID
    • MEDIUM_PURPLE

      public static final Color MEDIUM_PURPLE
    • MEDIUM_SEAG_REEN

      public static final Color MEDIUM_SEAG_REEN
    • MEDIUM_SLATE_BLUE

      public static final Color MEDIUM_SLATE_BLUE
    • MEDIUM_SPRING_GREEN

      public static final Color MEDIUM_SPRING_GREEN
    • MEDIUM_TURQUOISE

      public static final Color MEDIUM_TURQUOISE
    • MEDIUM_VIOLET_RED

      public static final Color MEDIUM_VIOLET_RED
    • MIDNIGHT_BLUE

      public static final Color MIDNIGHT_BLUE
    • MINT_CREAM

      public static final Color MINT_CREAM
    • MISTY_ROSE

      public static final Color MISTY_ROSE
    • MOCCASIN

      public static final Color MOCCASIN
    • OLDLACE

      public static final Color OLDLACE
    • OLIVE

      public static final Color OLIVE
    • OLIVE_DRAB

      public static final Color OLIVE_DRAB
    • ORANGE

      public static final Color ORANGE
    • ORANGERED

      public static final Color ORANGERED
    • ORCHID

      public static final Color ORCHID
    • PALE_GOLDEN_ROD

      public static final Color PALE_GOLDEN_ROD
    • PALE_GREEN

      public static final Color PALE_GREEN
    • PALE_TURQUOISE

      public static final Color PALE_TURQUOISE
    • PALE_VIOLET_RED

      public static final Color PALE_VIOLET_RED
    • PAPAYA_WHIP

      public static final Color PAPAYA_WHIP
    • PEACH_PUFF

      public static final Color PEACH_PUFF
    • PERU

      public static final Color PERU
    • PINK

      public static final Color PINK
    • PLUM

      public static final Color PLUM
    • POWDER_BLUE

      public static final Color POWDER_BLUE
    • PURPLE

      public static final Color PURPLE
    • REBECCA_PURPLE

      public static final Color REBECCA_PURPLE
    • RED

      public static final Color RED
    • ROSY_BROWN

      public static final Color ROSY_BROWN
    • ROYAL_BLUE

      public static final Color ROYAL_BLUE
    • SADDLE_BROWN

      public static final Color SADDLE_BROWN
    • SALMON

      public static final Color SALMON
    • SANDY_BROWN

      public static final Color SANDY_BROWN
    • SEA_GREEN

      public static final Color SEA_GREEN
    • SEA_SHELL

      public static final Color SEA_SHELL
    • SIENNA

      public static final Color SIENNA
    • SILVER

      public static final Color SILVER
    • SKY_BLUE

      public static final Color SKY_BLUE
    • SLATE_BLUE

      public static final Color SLATE_BLUE
    • SLATE_GRAY

      public static final Color SLATE_GRAY
    • SLATE_GREY

      public static final Color SLATE_GREY
    • SNOW

      public static final Color SNOW
    • SPRING_GREEN

      public static final Color SPRING_GREEN
    • STEEL_BLUE

      public static final Color STEEL_BLUE
    • TAN

      public static final Color TAN
    • TEAL

      public static final Color TEAL
    • THISTLE

      public static final Color THISTLE
    • TOMATO

      public static final Color TOMATO
    • TURQUOISE

      public static final Color TURQUOISE
    • VIOLET

      public static final Color VIOLET
    • WHEAT

      public static final Color WHEAT
    • CSS_WHITE

      public static final Color CSS_WHITE
    • WHITE_SMOKE

      public static final Color WHITE_SMOKE
    • YELLOW

      public static final Color YELLOW
    • YELLOW_GREEN

      public static final Color YELLOW_GREEN
  • Method Details

    • apply

      public void apply(Component<?> component)
      Apply the style setting on the specified component
      Specified by:
      apply in interface StyleElement
      Parameters:
      component - The component
    • remove

      public void remove(Component<?> component)
      Remove style settings from the component
      Specified by:
      remove in interface StyleElement
      Parameters:
      component - The component
    • getStyleClassName

      public String getStyleClassName()
      Gets the Bootstrap style class name
      Specified by:
      getStyleClassName in interface StyleElement
      Returns:
      The style class name or null if is not style class for the style settings
    • getStyleClassName

      public String getStyleClassName(ColorType type)
      Gets the Bootstrap style class name.
      Parameters:
      type - Style type
      Returns:
      The style class name or null if no style class corresponds to the settings
    • getColorCode

      public String getColorCode()
      Gets the color name in a text format. E.g. red, aqua, etc.
      Returns:
      Color name
    • apply

      public void apply(Component<?> component, ColorType type)
      Applies the style setting to the specified component with the specified type.
      Parameters:
      component - The component
      type - Color type
    • remove

      public void remove(Component<?> component, ColorType type)
      Removes the style setting from the specified component with the specified type.
      Parameters:
      component - The component
      type - Color type
    • fromRGB

      public static Color fromRGB(int red, int green, int blue)
      Creates a Color object from RGB codes. The RGB color values are used to set the text and the background color for the Color object.
      Parameters:
      red - Red color
      green - Green color
      blue - Blue color
      Returns:
      The created Color object
    • fromHexCode

      public static Color fromHexCode(String colorCode)
      Creates the Color based on the hexadecimal color codes in the parameter. The hexa color values are used to set the text and the background color for the Color object.
      Parameters:
      colorCode - Hexa color code (# optional)
      Returns:
      The created Color object
    • fromName

      public static Color fromName(String name)
      Parameters:
      name - The name of the button type
      Returns:
      The button type corresponding to the name or null, if not found
    • values

      public static Color[] values()
    • isTextColor

      public boolean isTextColor()
      Checks if the color can be used as a font color.
      Returns:
      If true, the color can be used as a font color, otherwise not
    • isBackgroundColor

      public boolean isBackgroundColor()
      Checks if the color can be used as a background color.
      Returns:
      If true, the color can be used as a background color
    • getName

      public String getName()
      Gets the color name.
      Returns:
      Color name
    • toString

      public String toString()
      Overrides:
      toString in class Object