Skip to content

Commit

Permalink
Update docs. Update build.
Browse files Browse the repository at this point in the history
Signed-off-by: regorxxx <[email protected]>
  • Loading branch information
regorxxx committed Mar 10, 2024
1 parent 3b85a96 commit 90cc076
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* added 'supported color spaces' to documentation
* minor improvements to documentation
* fix wrong handling of RGB and RGBA arrays when constructing chroma color objects.
* fix wrong handling of values outside scale domain due to internal Math.pow usage. See [Issue 331](https://github.com/gka/chroma.js/issues/331)

### 2.7.0
* added `chroma.brewer.getPalettes()` to retrieve all available palettes (keys). [ColorBrewer](http://colorbrewer2.org/) schemes (scales) are divided into palettes according to their type
Expand Down
4 changes: 3 additions & 1 deletion chroma.js
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,9 @@
t = tMapLightness(t); // lightness correction
}

if (_gamma !== 1) { t = pow$3(t, _gamma); }
if (t > 1) { t = 1; } // pow fails with negative bases, but values are always clamped to the extremes
else if (t < 0) { t = 0; }
else if (_gamma !== 1) { t = pow$3(t, _gamma); }

t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));

Expand Down
2 changes: 1 addition & 1 deletion chroma.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ <h3 id="unreleased">unreleased</h3>
<li>added &#39;supported color spaces&#39; to documentation</li>
<li>minor improvements to documentation</li>
<li>fix wrong handling of RGB and RGBA arrays when constructing chroma color objects.</li>
<li>fix wrong handling of values outside scale domain. See <a href="https://github.com/gka/chroma.js/issues/331">Issue 331</a></li>
</ul>
<h3 id="270">2.7.0</h3>
<ul>
Expand Down
4 changes: 3 additions & 1 deletion docs/libs/chroma.js
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,9 @@
t = tMapLightness(t); // lightness correction
}

if (_gamma !== 1) { t = pow$3(t, _gamma); }
if (t > 1) { t = 1; } // pow fails with negative bases, but values are always clamped to the extremes
else if (t < 0) { t = 0; }
else if (_gamma !== 1) { t = pow$3(t, _gamma); }

t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));

Expand Down
2 changes: 1 addition & 1 deletion docs/libs/chroma.min.js

Large diffs are not rendered by default.

0 comments on commit 90cc076

Please sign in to comment.