Class Colors

java.lang.Object
com.codename1.art.Colors

public final class Colors extends Object
Parses and formats CSS colors.
  • Method Details

    • parse

      public static int parse(String s, int def)

      Parses #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), hsla(), a named color or transparent.

      Parameters
      • s: the color text
      • def: returned when s is null or not a color
      Returns

      the color as 0xAARRGGBB

    • toHex

      public static String toHex(int argb)

      Formats a color as #rrggbb, ignoring alpha.

      Parameters
      • argb: the color