Package PamView
Class ColourArray
java.lang.Object
PamView.ColourArray
- All Implemented Interfaces:
Serializable
,Cloneable
,ManagedParameters
A series of functions for creating arrays of colours
Can be used for spectrogram colouring, contour colouring, etc.
- Author:
- Doug Gillespie
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckColour
(int iCol) Get a colour with index checking to make sure it's in the rangee 0 - nCol-1.static ColourArray
createBlackToWhiteArray
(int nPoints) static ColourArray
createHotArray
(int nPoints) Colour array from black to white, via red, orange and yellowstatic ColourArray
createHSVArray
(int nPoints) Color.RED, Color.YELLOW, Color.GREEN, Color.CYAN, Color.BLUE, Color.MAGENTA, Color.REDstatic ColourArray
createMergedArray
(int nPoints, Color c1, Color c2) static ColourArray
createMultiColouredArray
(int nPoints, Color... colourList) Create a multicoloured array of colours that merges in turn between each of the colours given in the list.static ColourArray
createPatrioticArray
(int nPoints) Red white blue colour arraystatic ColourArray
createRainbowArray
(int nPoints) Color.BLACK, Color.BLUE, Color.CYAN, Color.GREEN, Color.ORANGE, Color.REDstatic ColourArray
createStandardColourArray
(int nPoints, ColourArray.ColourArrayType type) static ColourArray
createWhiteToBlackArray
(int nPoints) int[]
get4IntColourArray
(int iCol) Get a four digit colour array with the alpha value set to 255 (opaque)getColour
(double colValue, double min, double max) Get a colour for a data value if the colourmap is between two data limits.getColour
(int iCol) Get the colour for the index.Color[]
Added just so that contrastingColor field would be included in getParameterSet methodReturn a contrasting colour which is different to ALL of the colours in the array.int[]
getIntColourArray
(int iCol) Get a three digit colour arraystatic String
int
Get a set of data that describes all of the parameters in a classvoid
void
setAlpha
(int alpha) void
setContrastingColour
(Color contrastingColor) Set a contrasting colour which is different to ALL of the colours in the array.
-
Method Details
-
getName
-
createStandardColourArray
-
createWhiteToBlackArray
-
createBlackToWhiteArray
-
createRainbowArray
Color.BLACK, Color.BLUE, Color.CYAN, Color.GREEN, Color.ORANGE, Color.RED- Parameters:
nPoints
-- Returns:
-
createHSVArray
Color.RED, Color.YELLOW, Color.GREEN, Color.CYAN, Color.BLUE, Color.MAGENTA, Color.RED- Parameters:
nPoints
-- Returns:
-
createHotArray
Colour array from black to white, via red, orange and yellow- Parameters:
nPoints
-- Returns:
-
createPatrioticArray
Red white blue colour array- Parameters:
nPoints
-- Returns:
-
createMultiColouredArray
Create a multicoloured array of colours that merges in turn between each of the colours given in the list.- Parameters:
nPoints
- total number of colour pointscolourList
- variable number of colours.- Returns:
- a new ColourArray object.
-
createMergedArray
-
getColours
-
checkColour
Get a colour with index checking to make sure it's in the rangee 0 - nCol-1.- Parameters:
iCol
- colour index- Returns:
- colour
-
getColour
Get the colour for the index. No checking so can throw an indexoutofbounds error- Parameters:
iCol
- colour index- Returns:
- colour
-
getIntColourArray
public int[] getIntColourArray(int iCol) Get a three digit colour array- Parameters:
iCol
-- Returns:
-
get4IntColourArray
public int[] get4IntColourArray(int iCol) Get a four digit colour array with the alpha value set to 255 (opaque)- Parameters:
iCol
-- Returns:
-
getNumbColours
public int getNumbColours() -
reverseArray
public void reverseArray() -
getContrastingColour
Return a contrasting colour which is different to ALL of the colours in the array. This can be used to draw additional lines over 3D plots made with the array colours.- Returns:
- the contrastingColor
-
getContrastingColor
Added just so that contrastingColor field would be included in getParameterSet method- Returns:
-
setAlpha
public void setAlpha(int alpha) -
setContrastingColour
Set a contrasting colour which is different to ALL of the colours in the array. This can be used to draw additional lines over 3D plots made with the array colours.- Parameters:
contrastingColor
- the contrastingColor to set
-
getColour
Get a colour for a data value if the colourmap is between two data limits.- Parameters:
colValue
- - the data value to find colour for.min
- - the minimum data value of the colour array.max
- - the maximum data value of the colour array.- Returns:
- colour representing the data value
-
getParameterSet
Description copied from interface:ManagedParameters
Get a set of data that describes all of the parameters in a class- Specified by:
getParameterSet
in interfaceManagedParameters
- Returns:
- description of the parameters in a class.
-