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 Summary
Constructors Constructor Description ColorScheme() -
Method Summary
Modifier and Type Method Description ColorIndexcolorForEachIndex(int numberColors)Assigns a color to each index value from a list of sizenumberColors.abstract ColorListcreateList(int size)Creates a sequence of related colors.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ColorScheme
public ColorScheme()
-
-
Method Details
-
createList
Creates a sequence of related colors.- Parameters:
size- the size of the list- Returns:
- a newly created list with colors
- Throws:
OperationFailedException
-
colorForEachIndex
Assigns a color to each index value from a list of sizenumberColors.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
-