D3 Colour Modules

d3js.org ↗

Use colour schemes and colour-space operations in D3 projects.

SI Score
80/100
Pricing
Open Source AI reading, not confirmed
Free plan
Yes AI reading, not confirmed
Sign-up required
Not confirmed

Ask SI about D3 Colour Modules

Answers use saved listing facts and recorded sources.
Homepage screenshot
Screenshot of the D3 Colour Modules homepage

What it does

D3’s ISC-licensed colour modules provide chart schemes and objects for parsing or changing individual colours. Sequential, diverging, cyclical and categorical families work with D3’s scale system.

A discrete sequential scheme returns a fixed list of HEX values; for example, the documented Blues family offers three to nine colours. Its continuous counterpart accepts a position from zero to one and returns an RGB string. Use the appropriate form with an ordinal or sequential scale.

For individual values, d3-color parses CSS colours, changes components or opacity and formats the result as RGB, HSL or HEX. Invalid text returns null. Formatting can clamp an out-of-range colour into a displayable value, so call displayable when the distinction matters.

D3 is open source under the ISC licence, with permission for use and redistribution when the copyright and permission notices are retained.

Strengths

  • Discrete arrays and continuous interpolation are documented separately.
  • Colour parsing, component edits and output formats share one object model.

Watch out for

  • The documented discrete sequential schemes have fixed supported sizes.
  • Formatted output may clamp values that were outside the displayable range.

Best for

  • Developers implementing colour scales in JavaScript charts

Sources