This commit is contained in:
Brooke Vibber 2023-03-24 00:30:25 -07:00
parent fe6314e2a0
commit 325102021b

View file

@ -13,7 +13,6 @@ function zeroes(n) {
return arr; return arr;
} }
/*
function toLinear(val) { function toLinear(val) {
// use a 2.4 gamma approximation // use a 2.4 gamma approximation
// this is BT.1886 compatible // this is BT.1886 compatible
@ -28,7 +27,6 @@ function fromLinear(val) {
unit **= (1 / 2.4); unit **= (1 / 2.4);
return unit * 255; return unit * 255;
} }
*/
function fromSRGB(val) { function fromSRGB(val) {
val /= 255; val /= 255;
@ -78,15 +76,13 @@ class RGB {
); );
} }
/* fromNTSC() {
toLinear() {
return this.map(toLinear); return this.map(toLinear);
} }
fromLinear() { toNTSC() {
return this.map(fromLinear); return this.map(fromLinear);
} }
*/
fromSRGB() { fromSRGB() {
return this.map(fromSRGB); return this.map(fromSRGB);
@ -429,7 +425,7 @@ let atariRGB = [
0xf6e46f, 0xf6e46f,
0xfffa84, 0xfffa84,
0xffff99, 0xffff99,
].map((hex) => RGB.fromHex(hex).fromSRGB()); ].map((hex) => RGB.fromHex(hex).fromNTSC());
//].map((hex) => RGB.fromHex(hex)); //].map((hex) => RGB.fromHex(hex));
/** /**