public class Colormap extends Object implements PaintScale, Serializable
PaintScale
that generate colors interpolated
within a list of given color, using a linear scale.Modifier and Type | Field and Description |
---|---|
static Colormap |
Jet
An
Colormap that maps a typical "Jet" colormap going
from blue to red to the range [0, 1]. |
static Colormap |
Turbo
The TURBO color-map, from Google LLC, Anton Mikhailov.
|
static Colormap |
Viridis
An
Colormap that replicates the matplotlib "Viridis"
colormap. |
Constructor and Description |
---|
Colormap(String name)
Create a paint scale with a lower bound of 0, an upper bound of 1 and a
default black color.
|
Colormap(String name,
double lowerBound,
double upperBound)
Create a paint scale with a given lower and upper bound and a default
black color.
|
Colormap(String name,
double lowerBound,
double upperBound,
Color defaultColor)
Create a paint scale with given lower and upper bound, and a specified
default color.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double value,
Color color)
Add a color to the color list of this paint scale, at the position given
by
value . |
Colormap |
clone() |
static List<Colormap> |
getAvailableLUTs() |
double |
getLowerBound() |
String |
getName() |
Color |
getPaint(double value)
Return a color interpolated within the color list of this paint scale.
|
double |
getUpperBound() |
static void |
main(String[] args) |
public static final Colormap Jet
Colormap
that maps a typical "Jet" colormap going
from blue to red to the range [0, 1].public static final Colormap Viridis
Colormap
that replicates the matplotlib "Viridis"
colormap.public static final Colormap Turbo
public Colormap(String name, double lowerBound, double upperBound, Color defaultColor)
public Colormap(String name, double lowerBound, double upperBound)
public Colormap(String name)
public String getName()
public void add(double value, Color color)
value
. If value
is greater than the upper
bound or lower than the lower bound set at construction, this call will
be ignored.public double getLowerBound()
getLowerBound
in interface PaintScale
public Color getPaint(double value)
getPaint
in interface PaintScale
public double getUpperBound()
getUpperBound
in interface PaintScale
public static void main(String[] args)
Copyright © 2015–2021 Fiji. All rights reserved.