Enum ColorFormat

java.lang.Object
java.lang.Enum<ColorFormat>
com.smartgwt.client.types.ColorFormat
All Implemented Interfaces:
ValueEnum, Serializable, Comparable<ColorFormat>, Constable

public enum ColorFormat extends Enum<ColorFormat> implements ValueEnum
Target format for Colors.getColor() and Colors.getString(), and optional format filter for Colors.isColor().
  • Enum Constant Details

    • RGB

      public static final ColorFormat RGB
      RGB (Red, Green, Blue). As an object: {r, g, b, alpha} with r/g/b as integers 0-255 and alpha as a float 0-1. As a string: "rgb(R, G, B)" or "rgba(R, G, B, A)".

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "rgb".

    • HSL

      public static final ColorFormat HSL
      HSL (Hue, Saturation, Lightness). As an object: {h, s, l, alpha} with h 0-360 degrees, s/l 0-100 percent, and alpha 0-1. As a string: "hsl(H, S%, L%)" or "hsla(H, S%, L%, A)".

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "hsl".

    • HEX

      public static final ColorFormat HEX
      Hexadecimal HTML color. String only (not used as a getColor target): "#RRGGBB" when fully opaque, "#RRGGBBAA" when semi-transparent. Each pair is a two-digit hex value 00-FF for red, green, blue, and optionally alpha.

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "hex".

    • OKLCH

      public static final ColorFormat OKLCH
      Oklch (OK Lightness, Chroma, Hue) -- a perceptually uniform color space where equal numeric changes produce visually equal differences. As an object: {L, C, h, alpha} with L (lightness) 0-1, C (chroma/saturation) typically 0-0.4, h (hue angle) 0-360 degrees, and alpha 0-1. As a string: "oklch(L% C h)" or "oklch(L% C h / A)".

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "oklch".

  • Method Details

    • values

      public static ColorFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ColorFormat valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Specified by:
      getValue in interface ValueEnum