org.apache.poi.xssf.usermodel

## Class CustomIndexedColorMap

- java.lang.Object
- - org.apache.poi.xssf.usermodel.CustomIndexedColorMap

- All Implemented Interfaces:
    IndexedColorMap

      public class CustomIndexedColorMap
      extends java.lang.Object
      implements IndexedColorMap

  custom index color map, i.e. from the styles.xml definition

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CustomIndexedColorMap` | `fromColors(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColors colors)` OOXML spec says if this exists it must have all indexes.
    `byte[]` | `getRGB(int index)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getRGB

          public byte[] getRGB(int index)

      Specified by:
        `getRGB` in interface `IndexedColorMap`
      Parameters:
        `index` - color index to look up
      Returns:
        the RGB array for the index, or null if the index is invalid/undefined

    - #### fromColors

          public static CustomIndexedColorMap fromColors(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColors colors)

      OOXML spec says if this exists it must have all indexes.

      From the OOXML Spec, Part 1, section 18.8.27:

      This element contains a sequence of RGB color values that correspond to color indexes (zero-based). When using the default indexed color palette, the values are not written out, but instead are implied. When the color palette has been modified from default, then the entire color palette is written out.

      Parameters:
        `colors` - CTColors from styles.xml possibly defining a custom color indexing scheme
      Returns:
        custom indexed color map or null if none defined in the document

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.