From ea946b2ae9370943cea35bc36bab4efaad9a5931 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 7 Jul 2023 20:46:28 +0000 Subject: [PATCH] Fix transparency for black-and-white rendering --- posts/2023/06/flam3/3a-binary.ts | 2 +- posts/2023/06/flam3/3b-linear.ts | 2 +- posts/2023/06/flam3/3c-logarithmic.ts | 2 +- posts/2023/06/flam3/index.tsx | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/posts/2023/06/flam3/3a-binary.ts b/posts/2023/06/flam3/3a-binary.ts index 728f716..0786baf 100644 --- a/posts/2023/06/flam3/3a-binary.ts +++ b/posts/2023/06/flam3/3a-binary.ts @@ -46,7 +46,7 @@ class AccumulateBinary extends Accumulator { image.data[iIdx + 0] = value; image.data[iIdx + 1] = value; image.data[iIdx + 2] = value; - image.data[iIdx + 3] = 0xff; + image.data[iIdx + 3] = value ? 0xff : 0; } } } diff --git a/posts/2023/06/flam3/3b-linear.ts b/posts/2023/06/flam3/3b-linear.ts index 4581ffd..42bf5d8 100644 --- a/posts/2023/06/flam3/3b-linear.ts +++ b/posts/2023/06/flam3/3b-linear.ts @@ -18,7 +18,7 @@ export class AccumulateLinear extends Accumulator { image.data[iIdx + 0] = value; image.data[iIdx + 1] = value; image.data[iIdx + 2] = value; - image.data[iIdx + 3] = 0xff; + image.data[iIdx + 3] = 0xff - value; } } } diff --git a/posts/2023/06/flam3/3c-logarithmic.ts b/posts/2023/06/flam3/3c-logarithmic.ts index b674321..7c6939d 100644 --- a/posts/2023/06/flam3/3c-logarithmic.ts +++ b/posts/2023/06/flam3/3c-logarithmic.ts @@ -24,7 +24,7 @@ export class AccumulateLogarithmic extends Accumulator { image.data[iIdx + 0] = value; image.data[iIdx + 1] = value; image.data[iIdx + 2] = value; - image.data[iIdx + 3] = 0xff; + image.data[iIdx + 3] = 0xff - value; } } } diff --git a/posts/2023/06/flam3/index.tsx b/posts/2023/06/flam3/index.tsx index c0608e4..3166430 100644 --- a/posts/2023/06/flam3/index.tsx +++ b/posts/2023/06/flam3/index.tsx @@ -22,7 +22,7 @@ export default function () { }); return ( - {/*
+
@@ -33,10 +33,10 @@ export default function () {
-
*/} - +
+ {/* - + */}
); }