asciify-engine 1.0.58 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -284,7 +284,8 @@ function getCellColorStr(cell, colorMode, acR, acG, acB, _isInverted = false) {
|
|
|
284
284
|
case "matrix":
|
|
285
285
|
return GREEN_LUT[0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b | 0];
|
|
286
286
|
case "accent": {
|
|
287
|
-
const
|
|
287
|
+
const rawAb = (0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b) / 255;
|
|
288
|
+
const ab = _isInverted ? 1 - rawAb : rawAb;
|
|
288
289
|
return `rgb(${acR * ab | 0},${acG * ab | 0},${acB * ab | 0})`;
|
|
289
290
|
}
|
|
290
291
|
default: {
|
|
@@ -309,7 +310,8 @@ function getCellColorRGB(cell, colorMode, acR, acG, acB, _isInverted = false) {
|
|
|
309
310
|
break;
|
|
310
311
|
}
|
|
311
312
|
case "accent": {
|
|
312
|
-
const
|
|
313
|
+
const rawAb = (0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b) / 255;
|
|
314
|
+
const ab = _isInverted ? 1 - rawAb : rawAb;
|
|
313
315
|
_colorRGB[0] = acR * ab | 0;
|
|
314
316
|
_colorRGB[1] = acG * ab | 0;
|
|
315
317
|
_colorRGB[2] = acB * ab | 0;
|