Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColorScale

Once initialized, ColorScale steps through a series of colors each time get() is called.

Hierarchy

  • ColorScale

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ColorScale(basecolor: string, steps: number): ColorScale
  • Parameters

    • basecolor: string

      Initial color.

    • steps: number

      How many steps to go through before looping around to the initial color.

    Returns ColorScale

Properties

basecolor

basecolor: string

The initial color.

scale

scale: Linear<string, string>

d3.scale.Linear is used for interpolation.

step

step: number

The current step.

steps

steps: number

How many steps to go through before looping around to the initial color.

Methods

copy

get

  • get(): string
  • Increases step by one and returns the appropriately lerped color.

    Returns string

Generated using TypeDoc