SNTColor Class Documentation#
Package: sc.fiji.snt.util
A simple class for handling Colors including the ability to map an AWT Color to a SWC type integer tag.
Methods#
Getters Methods#
- static getDistinctColors(int)
Returns distinct colors based on Kenneth Kelly’s 22 colors of maximum contrast (black and white excluded). More details on this SO discussion
- static getDistinctColorsAWT(int)
- static getDistinctColorsHex(int, String)
- isTypeDefined()#
Checks if an SWC type has been defined.
Setters Methods#
- setAWTColor(Color)#
Re-assigns an AWT color.
- setSWCType(int)#
Re-assigns a SWC type integer flag
Other Methods#
- static alphaColor(Color, double)
Adds an alpha component to an AWT color.
- static average(Collection)
Averages a collection of colors
- color()#
Retrieves the AWT color
- static colorToString(Object)
Returns the color encoded as hex string with the format #rrggbbaa.
- static contrastColor(Color)
Returns a suitable ‘contrast’ color.
- static fromHex(String)
Returns an AWT Color from a (#)RRGGBB(AA) hex string.
- static interpolateNullEntries(Color;)
Replaces null colors in an array with the average of flanking non-null colors.
- type()#
Retrieves the SWC type
- static valueOf(String)