Enum CarColor

java.lang.Object
java.lang.Enum<CarColor>
com.codename1.car.CarColor
All Implemented Interfaces:
Comparable<CarColor>

public enum CarColor extends Enum<CarColor>
A small, head-unit-safe colour palette for CarAction backgrounds and accents. In-car UIs do not allow arbitrary ARGB colours (the system tints for legibility and theme/contrast compliance), so the API exposes named roles that each platform maps to its own car colour (androidx.car.app.model.CarColor / the CarPlay system tint).
  • Enum Constant Details

    • DEFAULT

      public static final CarColor DEFAULT
      The head unit's default colour for the element.
    • PRIMARY

      public static final CarColor PRIMARY
      The app's primary/accent colour as resolved by the head unit theme.
    • RED

      public static final CarColor RED
      A red role, typically for destructive or stop/cancel actions.
    • GREEN

      public static final CarColor GREEN
      A green role, typically for confirm/go actions.
    • BLUE

      public static final CarColor BLUE
      A blue role.
    • YELLOW

      public static final CarColor YELLOW
      A yellow/amber role, typically for cautionary actions.
  • Method Details

    • values

      public static CarColor[] 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 CarColor 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