ColorScale

org.appliedtopology.tda4j.plot.ColorScale
See theColorScale companion object
final case class ColorScale(ramp: Ramp = ..., lo: Double = ..., hi: Double = ..., label: String = ..., transform: Transform = ..., stops: Option[IndexedSeq[String]] = ..., guide: Boolean = ...)

How the data values of Paint.Value marks become colors: the figure's one continuous color scale, and the color bar drawn from it.

Marks hold the values, not the colors, so the colors follow the figure's Palette and can be re-limited (Scale.color(min = 0, max = 10)) to put two figures on one scale. A Diverging scale is symmetric: lo = -hi. A Cyclic scale reads its values as turns, 0 and 1 being the same color.

Value parameters

guide

whether to draw the color bar

hi

the value of the high end

label

the color bar's title

lo

the value of the low end of the ramp

stops

the colors of a Sequential ramp, light to dark, instead of the palette's own (for example ColorScale.viridis); evenly spaced and mixed in OKLab

transform

how values are spread along a Sequential ramp (Transform.Sqrt for a heavy-tailed image); the other ramps are always linear. A Log10 scale that starts at 0 or below is a symmetric log, linear within a thousandth of its largest magnitude, so that every value has a color

Attributes

Companion
object
Experimental
true
Source
ColorScale.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def barColor(t: Double, palette: Palette): String

The color a fraction t of the way along the ramp, 0 at the low end: what the color bar draws.

The color a fraction t of the way along the ramp, 0 at the low end: what the color bar draws.

Attributes

Source
ColorScale.scala
def barTicks: Seq[(Double, Double)]

The values labelled along the color bar between its two ends, each with its fraction of the way up the bar. A linear bar needs only its ends. On a Sequential scale spread by a transform the middle is round numbers of the data, each where the transform puts it (on a square-root bar 1 is half way to 4), so that the bar can be read.

The values labelled along the color bar between its two ends, each with its fraction of the way up the bar. A linear bar needs only its ends. On a Sequential scale spread by a transform the middle is round numbers of the data, each where the transform puts it (on a square-root bar 1 is half way to 4), so that the bar can be read.

Attributes

Source
ColorScale.scala
def hex(v: Double, palette: Palette): String

The color for the value v (hex), as palette has it.

The color for the value v (hex), as palette has it.

Attributes

Source
ColorScale.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala