Enum Class ExcelColorPalette

java.lang.Object
java.lang.Enum<ExcelColorPalette>
com.northconcepts.datapipeline.excel.ExcelColorPalette
All Implemented Interfaces:
Serializable, Comparable<ExcelColorPalette>, Constable

public enum ExcelColorPalette extends Enum<ExcelColorPalette>
Excel-compatible indexed color palette (BIFF legacy)
  • Enum Constant Details

  • Method Details

    • values

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

      public static ExcelColorPalette valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getIndex

      public Integer getIndex()
      Gets the Excel color palette index.
      Returns:
      the palette index
    • getRed

      public Integer getRed()
      Gets the red component of the color.
      Returns:
      the red component (0-255), or null for AUTOMATIC
    • getGreen

      public Integer getGreen()
      Gets the green component of the color.
      Returns:
      the green component (0-255), or null for AUTOMATIC
    • getBlue

      public Integer getBlue()
      Gets the blue component of the color.
      Returns:
      the blue component (0-255), or null for AUTOMATIC
    • getDescription

      public String getDescription()
      Gets the description of the color.
      Returns:
      the color description
    • getRgb

      public Integer getRgb()
      Gets the RGB value as a single integer (0xRRGGBB format).
      Returns:
      the RGB value, or null for AUTOMATIC
    • getHex

      public String getHex()
      Gets the color as a hexadecimal string (e.g., "#RRGGBB").
      Returns:
      the hex color string, or null for AUTOMATIC
    • getExcelColor

      public ExcelColor getExcelColor()
      Gets the ExcelColor instance for this palette color.
      Returns:
      the ExcelColor instance
    • fromIndex

      public static ExcelColorPalette fromIndex(int index)
      Finds a palette color by its index.
      Parameters:
      index - the palette index to search for
      Returns:
      the matching ExcelColorPalette, or null if not found
    • fromRgb

      public static ExcelColorPalette fromRgb(int red, int green, int blue)
      Finds a palette color by its RGB components.
      Parameters:
      red - the red component (0-255)
      green - the green component (0-255)
      blue - the blue component (0-255)
      Returns:
      the matching ExcelColorPalette, or null if not found
    • fromHex

      public static ExcelColorPalette fromHex(String hex)
      Finds a palette color by its hexadecimal representation.
      Parameters:
      hex - the hex color string (e.g., "#RRGGBB" or "RRGGBB")
      Returns:
      the matching ExcelColorPalette, or null if not found or invalid format