View Source Plox.ColorScale protocol (Plox v0.2.0)

A protocol for graph color scales.

Any graph color scale must implement this protocol in order to be used by the Plox.graph component.

Summary

Types

t()

Any struct that implements this protocol

Functions

Converts a specific scale value to a color.

Types

color()

@type color() :: String.t()

t()

@type t() :: any()

Any struct that implements this protocol

Built in implementations are:

Functions

convert_to_color(scale, value)

@spec convert_to_color(scale :: t(), any()) :: color() | nil

Converts a specific scale value to a color.