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.js
CHANGED
|
@@ -282,7 +282,8 @@ function getCellColorStr(cell, colorMode, acR, acG, acB, _isInverted = false) {
|
|
|
282
282
|
case "matrix":
|
|
283
283
|
return GREEN_LUT[0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b | 0];
|
|
284
284
|
case "accent": {
|
|
285
|
-
const
|
|
285
|
+
const rawAb = (0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b) / 255;
|
|
286
|
+
const ab = _isInverted ? 1 - rawAb : rawAb;
|
|
286
287
|
return `rgb(${acR * ab | 0},${acG * ab | 0},${acB * ab | 0})`;
|
|
287
288
|
}
|
|
288
289
|
default: {
|
|
@@ -307,7 +308,8 @@ function getCellColorRGB(cell, colorMode, acR, acG, acB, _isInverted = false) {
|
|
|
307
308
|
break;
|
|
308
309
|
}
|
|
309
310
|
case "accent": {
|
|
310
|
-
const
|
|
311
|
+
const rawAb = (0.299 * cell.r + 0.587 * cell.g + 0.114 * cell.b) / 255;
|
|
312
|
+
const ab = _isInverted ? 1 - rawAb : rawAb;
|
|
311
313
|
_colorRGB[0] = acR * ab | 0;
|
|
312
314
|
_colorRGB[1] = acG * ab | 0;
|
|
313
315
|
_colorRGB[2] = acB * ab | 0;
|