Package org.jmol.util

Class ColorEncoder

java.lang.Object
org.jmol.util.ColorEncoder

public class ColorEncoder extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • clearCache

      public void clearCache()
    • createColorScheme

      public int createColorScheme(String colorScheme, boolean defaultToRoygb, boolean isOverloaded)
      Parameters:
      colorScheme - name or name= or name=[x......] [x......] .... or name=red,green,blue or filename or https://...
      defaultToRoygb -
      isOverloaded -
      Returns:
      paletteID
    • setUserScale

      public void setUserScale(int[] scale)
    • getColorSchemeArray

      public int[] getColorSchemeArray(int palette)
    • getColorIndexFromPalette

      public short getColorIndexFromPalette(float val, float lo, float hi, int palette, boolean isTranslucent)
    • getArgbFromPalette

      public int getArgbFromPalette(float val, float lo, float hi, int palette)
    • getArgb

      public int getArgb(float val)
    • getArgbMinMax

      public int getArgbMinMax(float val, float min, float max)
    • getColorIndex

      public short getColorIndex(float val)
    • getColorKey

      public Map<String,Object> getColorKey()
    • getColorScheme

      public String getColorScheme()
    • setColorScheme

      public void setColorScheme(String colorScheme, boolean isTranslucent)
      Parameters:
      colorScheme -
      isTranslucent -
    • setRange

      public void setRange(float lo, float hi, boolean isReversed)
    • getCurrentColorSchemeName

      public String getCurrentColorSchemeName()
    • getColorSchemeName

      public String getColorSchemeName(int i)
    • getColorSchemeList

      public static final String getColorSchemeList(int[] scheme)
    • getRasmolScale

      public static final int[] getRasmolScale()
    • getPaletteAtoB

      public static int[] getPaletteAtoB(int color1, int color2, int n)
    • quantize

      public float quantize(float x, boolean isLowEnd)
      gets the value at the color boundary for this color range fraction
      Parameters:
      x -
      isLowEnd -
      Returns:
      quantized value
    • quantize4

      public static final int quantize4(float val, float lo, float hi, int segmentCount)