From 325102021baa0da6ea19ff6ce0d835157db5d8be Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 24 Mar 2023 00:30:25 -0700 Subject: [PATCH] nice --- dither-image.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dither-image.js b/dither-image.js index 2c9e252..ebe7faf 100644 --- a/dither-image.js +++ b/dither-image.js @@ -13,7 +13,6 @@ function zeroes(n) { return arr; } -/* function toLinear(val) { // use a 2.4 gamma approximation // this is BT.1886 compatible @@ -28,7 +27,6 @@ function fromLinear(val) { unit **= (1 / 2.4); return unit * 255; } -*/ function fromSRGB(val) { val /= 255; @@ -78,15 +76,13 @@ class RGB { ); } - /* - toLinear() { + fromNTSC() { return this.map(toLinear); } - fromLinear() { + toNTSC() { return this.map(fromLinear); } - */ fromSRGB() { return this.map(fromSRGB); @@ -429,7 +425,7 @@ let atariRGB = [ 0xf6e46f, 0xfffa84, 0xffff99, -].map((hex) => RGB.fromHex(hex).fromSRGB()); +].map((hex) => RGB.fromHex(hex).fromNTSC()); //].map((hex) => RGB.fromHex(hex)); /**