C
Date: 2019-10-22

org.jmol.util

## Class C

- java.lang.Object
- - org.jmol.util.C

-     public final class C
      extends java.lang.Object

  Note: Color table is now in javajs/util/CU.java

  Implements a color index model using a colix as a COLor IndeX.

  A colix is a color index represented as a short int.

  The value 0 is considered a null value ... for no color. In Jmol this generally means that the value is inherited from some other object.

  The value 1 is used to indicate that color only is to be inherited. 0x0001 INHERIT_OPAQUE -- opaque, but with the color coming from the parent. 0x4001 INHERIT_TRANSLUCENT -- translucent but with the color coming from the parent. The value 2 is used to indicate that one of the palettes is to be used. 0x0002 PALETTE, opaque 0x4002 PALETTE, translucent Palettes themselves are coded separately in a Palette ID that is tracked with

  Author:
    Miguel, miguel@jmol.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALPHA_SHIFT`
    `(package private) static int[]` | `argbs`
    `private static int[]` | `argbsGreyscale`
    `static short` | `BLACK`
    `static short` | `BLUE`
    `static short` | `CHANGEABLE_MASK`
    `private static Int2IntHash` | `colixHash`
    `(package private) static int` | `colixMax`
    `static short` | `CYAN`
    `static short` | `GOLD`
    `static short` | `GRAY`
    `static short` | `GREEN`
    `static short` | `HOTPINK`
    `static short` | `INHERIT_ALL`
    `static short` | `INHERIT_COLOR`
    `static int` | `LAST_AVAILABLE_COLIX`
    `static short` | `LIME`
    `static short` | `MAGENTA`
    `static short` | `MAROON`
    `static short` | `NAVY`
    `static short` | `OLIVE`
    `static short` | `OPAQUE_MASK`
    `static short` | `ORANGE`
    `static short` | `PINK`
    `static short` | `PURPLE`
    `static short` | `RAW_RGB`
    `private static int` | `RAW_RGB_INT`
    `static short` | `RED`
    `static short` | `SILVER`
    `static short` | `SPECIAL_COLIX_MAX`
    `static short` | `TEAL`
    `static int` | `TRANSLUCENT_MASK`
    `static int` | `TRANSLUCENT_SCREENED`
    `static int` | `TRANSLUCENT_SHIFT`
    `static int` | `TRANSPARENT`
    `static short` | `UNMASK_CHANGEABLE_TRANSLUCENT`
    `static short` | `USE_PALETTE`
    `static short` | `WHITE`
    `static short` | `YELLOW`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `C()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `allocateColix(int argb, boolean forceLast)`
    `(package private) static void` | `calcArgbsGreyscale()`
    `static short` | `copyColixTranslucency(short colixFrom, short colixTo)`
    `static int` | `getArgb(short colix)`
    `static int` | `getArgbGreyscale(short colix)`
    `static short` | `getBgContrast(int argb)`
    `static short` | `getChangeableColixIndex(short colix)`
    `static short` | `getColix(int argb)`
    `static short[]` | `getColixArray(java.lang.String colorNames)`
    `static short` | `getColixInherited(short myColix, short parentColix)`
    `static short` | `getColixO(java.lang.Object obj)`
    `static short` | `getColixS(java.lang.String colorName)`
    `static float` | `getColixTranslucencyFractional(short colix)`
    `static java.lang.String` | `getColixTranslucencyLabel(short colix)`
    `static int` | `getColixTranslucencyLevel(short colix)`
    `static short` | `getColixTranslucent(int argb)`
    `static short` | `getColixTranslucent3(short colix, boolean isTranslucent, float translucentLevel)`
    `static java.lang.String` | `getHexCode(short colix)`
    `static java.lang.String` | `getHexCodes(short[] colixes)`
    `private static int` | `getTranslucentFlag(float translucentLevel)`
    `static boolean` | `isColixColorInherited(short colix)`
    `static boolean` | `isColixLastAvailable(short colix)`
    `static boolean` | `isColixTranslucent(short colix)`
    `static boolean` | `renderPass2(short colix)`
    `(package private) static void` | `setLastGrey(int argb)`

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

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

- - ### Field Detail

    - #### INHERIT_ALL

          public static final short INHERIT_ALL

      See Also:
        Constant Field Values

    - #### INHERIT_COLOR

          public static final short INHERIT_COLOR

      See Also:
        Constant Field Values

    - #### USE_PALETTE

          public static final short USE_PALETTE

      See Also:
        Constant Field Values

    - #### RAW_RGB

          public static final short RAW_RGB

      See Also:
        Constant Field Values

    - #### SPECIAL_COLIX_MAX

          public static final short SPECIAL_COLIX_MAX

      See Also:
        Constant Field Values

    - #### colixMax

          static int colixMax

    - #### argbs

          static int[] argbs

    - #### argbsGreyscale

          private static int[] argbsGreyscale

    - #### colixHash

          private static final Int2IntHash colixHash

    - #### RAW_RGB_INT

          private static final int RAW_RGB_INT

      See Also:
        Constant Field Values

    - #### UNMASK_CHANGEABLE_TRANSLUCENT

          public static final short UNMASK_CHANGEABLE_TRANSLUCENT

      See Also:
        Constant Field Values

    - #### CHANGEABLE_MASK

          public static final short CHANGEABLE_MASK

      See Also:
        Constant Field Values

    - #### LAST_AVAILABLE_COLIX

          public static final int LAST_AVAILABLE_COLIX

      See Also:
        Constant Field Values

    - #### TRANSLUCENT_SHIFT

          public static final int TRANSLUCENT_SHIFT

      See Also:
        Constant Field Values

    - #### ALPHA_SHIFT

          public static final int ALPHA_SHIFT

      See Also:
        Constant Field Values

    - #### TRANSLUCENT_MASK

          public static final int TRANSLUCENT_MASK

      See Also:
        Constant Field Values

    - #### TRANSLUCENT_SCREENED

          public static final int TRANSLUCENT_SCREENED

      See Also:
        Constant Field Values

    - #### TRANSPARENT

          public static final int TRANSPARENT

      See Also:
        Constant Field Values

    - #### OPAQUE_MASK

          public static final short OPAQUE_MASK

      See Also:
        Constant Field Values

    - #### BLACK

          public static final short BLACK

      See Also:
        Constant Field Values

    - #### ORANGE

          public static final short ORANGE

      See Also:
        Constant Field Values

    - #### PINK

          public static final short PINK

      See Also:
        Constant Field Values

    - #### BLUE

          public static final short BLUE

      See Also:
        Constant Field Values

    - #### WHITE

          public static final short WHITE

      See Also:
        Constant Field Values

    - #### CYAN

          public static final short CYAN

      See Also:
        Constant Field Values

    - #### RED

          public static final short RED

      See Also:
        Constant Field Values

    - #### GREEN

          public static final short GREEN

      See Also:
        Constant Field Values

    - #### GRAY

          public static final short GRAY

      See Also:
        Constant Field Values

    - #### SILVER

          public static final short SILVER

      See Also:
        Constant Field Values

    - #### LIME

          public static final short LIME

      See Also:
        Constant Field Values

    - #### MAROON

          public static final short MAROON

      See Also:
        Constant Field Values

    - #### NAVY

          public static final short NAVY

      See Also:
        Constant Field Values

    - #### OLIVE

          public static final short OLIVE

      See Also:
        Constant Field Values

    - #### PURPLE

          public static final short PURPLE

      See Also:
        Constant Field Values

    - #### TEAL

          public static final short TEAL

      See Also:
        Constant Field Values

    - #### MAGENTA

          public static final short MAGENTA

      See Also:
        Constant Field Values

    - #### YELLOW

          public static final short YELLOW

      See Also:
        Constant Field Values

    - #### HOTPINK

          public static final short HOTPINK

      See Also:
        Constant Field Values

    - #### GOLD

          public static final short GOLD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### C

          public C()

  - ### Method Detail

    - #### getColix

          public static short getColix(int argb)

    - #### allocateColix

          public static int allocateColix(int argb,
                                          boolean forceLast)

    - #### setLastGrey

          static void setLastGrey(int argb)

    - #### calcArgbsGreyscale

          static void calcArgbsGreyscale()

    - #### getArgbGreyscale

          public static final int getArgbGreyscale(short colix)

    - #### getColixO

          public static short getColixO(java.lang.Object obj)

    - #### getTranslucentFlag

          private static int getTranslucentFlag(float translucentLevel)

    - #### isColixLastAvailable

          public static boolean isColixLastAvailable(short colix)

    - #### getArgb

          public static int getArgb(short colix)

    - #### isColixColorInherited

          public static final boolean isColixColorInherited(short colix)

    - #### getColixInherited

          public static final short getColixInherited(short myColix,
                                                      short parentColix)

    - #### renderPass2

          public static final boolean renderPass2(short colix)

    - #### isColixTranslucent

          public static final boolean isColixTranslucent(short colix)

    - #### getChangeableColixIndex

          public static final short getChangeableColixIndex(short colix)

    - #### getColixTranslucent3

          public static final short getColixTranslucent3(short colix,
                                                         boolean isTranslucent,
                                                         float translucentLevel)

    - #### copyColixTranslucency

          public static final short copyColixTranslucency(short colixFrom,
                                                          short colixTo)

    - #### getColixTranslucencyFractional

          public static float getColixTranslucencyFractional(short colix)

    - #### getColixTranslucencyLabel

          public static java.lang.String getColixTranslucencyLabel(short colix)

    - #### getColixTranslucencyLevel

          public static final int getColixTranslucencyLevel(short colix)

    - #### getColixS

          public static short getColixS(java.lang.String colorName)

    - #### getColixArray

          public static short[] getColixArray(java.lang.String colorNames)

    - #### getHexCode

          public static java.lang.String getHexCode(short colix)

    - #### getHexCodes

          public static java.lang.String getHexCodes(short[] colixes)

    - #### getColixTranslucent

          public static short getColixTranslucent(int argb)

    - #### getBgContrast

          public static short getBgContrast(int argb)