Skip to content

Commit

Permalink
update color-helpers (#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke authored Nov 1, 2023
1 parent 3f89182 commit c728bfa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/color-helpers/dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* @see https://en.wikipedia.org/wiki/SRGB
*/
function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))}
function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))}
/**
* Simple matrix (and vector) multiplication
* Warning: No error handling for incompatible dimensions!
Expand Down
2 changes: 1 addition & 1 deletion packages/color-helpers/dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function clip(t){return t.map((t=>t<0?0:t>1?1:t))}
*
* @see https://en.wikipedia.org/wiki/SRGB
*/
function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))}
function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))}
/**
* Simple matrix (and vector) multiplication
* Warning: No error handling for incompatible dimensions!
Expand Down
6 changes: 3 additions & 3 deletions packages/color-helpers/scripts/hashes.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
"384d52db3fcd98381e18743e1eba590a",
"6014c79b98dfe166e3e02232d8c3beaa",
"f736dea5b83ebcd853449a02255f747e",
"094c9859b0960c4e394947cc4832b54f",
"c9e2f2a3b2cba543a01cb8aa5d77c04a",
"f28e9d179704b95a9cd40fbf5b5f1164",
"a0b388982712b1849c991ce0e323828e"
"840ef26f992267c924230a26f939eaad",
"f912dea8d7d9813556f3ece0730f5392"
]
2 changes: 1 addition & 1 deletion packages/color-helpers/src/conversions/lin-srgb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function lin_sRGB(RGB: Color): Color {
const sign = val < 0 ? -1 : 1;
const abs = Math.abs(val);

if (abs < 0.04045) {
if (abs <= 0.04045) {
return val / 12.92;
}

Expand Down

0 comments on commit c728bfa

Please sign in to comment.