Repository navigation
Releases: mapequation/c3
Releases · mapequation/c3
Release list
c3 2.0.1
c3 2.0.1 retunes two tones and is the first release of the Python package, c3-colors.
Tones
strong, the default: lightness 0.58–0.76 and chroma 0.11–0.17 (was 0.55–0.76 and 0.08–0.17). Colors differ less in lightness and chroma, so none stands out, and the tone still fits about 32 colors 0.04 apart.deep: chroma 0.13–0.20 (was 0.10–0.17) at the same lightness, so it is as colorful asvivid, but darker.
Palettes and hierarchies in these tones get new colors. To keep the 2.0.0 colors, pass the old ranges, like tone: { lightness: [0.55, 0.76], chroma: [0.08, 0.17] }.
Python
- c3-colors on PyPI:
pip install c3-colors, imported asc3. It has the same API as the JavaScript package and gives the same colors, checked against shared fixtures. It has no dependencies.
Docs
- https://mapequation.org/c3/ has a JavaScript/Python switch for all examples, a Python tutorial, and a US map below Quality in every tab that shows the colors by Census division or by state.
c3 2.0.0
c3 2.0.0 adds palette() and hierarchy(), which pick colors in OKLCH, and removes the 1.x API.
New
palette(n, options): distinct categorical colors spread over hue, lightness and chroma. It stays deterministic, and asking for more colors never changes the earlier ones.tonesets lightness and chroma. It takes a named tone (vivid,bright,strong(the default),deep,dark,soft,pastelormuted), colors to match, or your own ranges.huetakes hues from the OKLCH hue circle ("Oklch", the default) or any d3 color scheme.offsetsets where the first color sits, in degrees.seedsstarts the palette from colors you pick;method: "farthest"or"lookahead"then adds colors as far from them as possible.endgives later colors their own lightness, so they don't compete with the first ones.
hierarchy(modules, options): colors for nested modules, such as an Infomap tree. Children vary around their parent's color, stay within the tone, and stay apart from their cousins.- Helpers:
tones,inferTone,swatches, andoklab,oklchanddistancefor measuring how distinct colors are. - Docs: a new documentation app at https://mapequation.github.io/c3.
Breaking changes
| 1.x | 2.0 |
|---|---|
colors(n, { scheme }) |
palette(n, { hue: scheme }) |
stops(), Node |
Removed from the public API |
skewness |
Removed. Use an end zone (end) to set later colors apart |
See the README for all options.