Class Color

java.lang.Object
com.persequor.extension.frontend.Color
Direct Known Subclasses:
ThemeColor

public class Color extends Object
  • Field Details

    • r

      protected final int r
    • g

      protected final int g
    • b

      protected final int b
    • a

      protected final float a
    • name

      protected String name
    • themeType

      protected ColorThemeType themeType
    • colorMode

      protected ColorMode colorMode
  • Constructor Details

    • Color

      public Color(int r, int g, int b)
    • Color

      public Color(int r, int g, int b, float a)
  • Method Details

    • primary

      public static ThemeColor primary()
    • secondary

      public static ThemeColor secondary()
    • standard

      public static ThemeColor standard()
    • info

      public static ThemeColor info()
    • success

      public static ThemeColor success()
    • warning

      public static ThemeColor warning()
    • error

      public static ThemeColor error()
    • inherit

      public static ThemeColor inherit()
    • fromString

      public static Color fromString(String string)
      Parameters:
      string - Value should be a CSS color name or a hex string starting with '#' of length 7 or 9
    • fromHSL

      public static Color fromHSL(int hue, int saturation, int lightness)
    • fromHSLA

      public static Color fromHSLA(int hue, int saturation, int lightness, float alpha)
      Parameters:
      hue - The hue, integer value from 0 to 360
      saturation - The saturation, value from 0 to 100 (percentage)
      lightness - The lightness, value from 0 to 100 (percentage)
      alpha - The aplha channel a.k.a. transparentness float value from 0 to 1
      Returns:
      the color object
    • getR

      public Integer getR()
    • getG

      public Integer getG()
    • getB

      public Integer getB()
    • getA

      public Float getA()
    • getName

      public String getName()
    • getColorMode

      public ColorMode getColorMode()
    • getType

      public ColorThemeType getType()
    • maroon

      public static Color maroon()
    • red

      public static Color red()
    • orange

      public static Color orange()
    • yellow

      public static Color yellow()
    • olive

      public static Color olive()
    • green

      public static Color green()
    • purple

      public static Color purple()
    • fuchsia

      public static Color fuchsia()
    • lime

      public static Color lime()
    • teal

      public static Color teal()
    • aqua

      public static Color aqua()
    • blue

      public static Color blue()
    • black

      public static Color black()
    • gray

      public static Color gray()
    • silver

      public static Color silver()
    • white

      public static Color white()
    • getBasicColors

      public static List<Color> getBasicColors()
    • toString

      public String toString()
      Overrides:
      toString in class Object