Class ColorScheme

Object
org.anchoranalysis.bean.AnchorBean<ColorScheme>
org.anchoranalysis.bean.shared.color.scheme.ColorScheme
Direct Known Subclasses:
ColorSchemeUnary, FromList, FromSingle, HSB, VeryBright

public abstract class ColorScheme
extends AnchorBean<ColorScheme>
Creates a sequence of related colors.
Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • createList

      public abstract ColorList createList​(int size) throws OperationFailedException
      Creates a sequence of related colors.
      Parameters:
      size - the size of the list
      Returns:
      a newly created list with colors
      Throws:
      OperationFailedException
    • colorForEachIndex

      public ColorIndex colorForEachIndex​(int numberColors) throws OperationFailedException
      Assigns a color to each index value from a list of size numberColors.

      This allows non-contiguous indices to each use a unique-ish color.

      Indices will be assigned a unique color until the list has no more unique colors, at which point they will be reused.

      Beware that as each index is remembered in a hash-map, this can become inefficient for a large number of indices.

      Parameters:
      numberColors - the size of the list from which colors are selected
      Returns:
      a newly created index
      Throws:
      OperationFailedException