@@ -364,13 +364,13 @@ class PaletteColorLookupTable {
364364 ]
365365 const maxInput = Math . max ( ...maxValues )
366366 const maxOutput = 255
367-
367+
368368 // Apply gamma correction to compensate for display gamma (brightens mid-tones)
369369 // When a linear intensity value i (0 to 1) is looked up, we actually want to look up
370370 // the color at position i^gamma where gamma = 1/2.2 ≈ 0.4545
371371 // This pre-brightens the colors for mid-tones
372- const gammaInverse = 1.0 / 2.2 // ≈ 0.4545
373-
372+ const gammaInverse = 1.0 / 2.2 // ≈ 0.4545
373+
374374 if ( this [ _attrs ] . bitsPerEntry === 16 && maxInput > 255 ) {
375375 /*
376376 * Only palettes with 256 entries and 8 bit per entry are supported for
@@ -384,7 +384,7 @@ class PaletteColorLookupTable {
384384 const normalizedPos = i / ( n - 1 )
385385 const gammaCorrectedPos = Math . pow ( normalizedPos , gammaInverse )
386386 const lutIndex = Math . round ( gammaCorrectedPos * ( this [ _attrs ] . numberOfEntries - 1 ) )
387-
387+
388388 this [ _attrs ] . data [ i ] = [
389389 Math . round ( rescale ( redLUT [ lutIndex ] , 0 , maxInput , 0 , maxOutput ) ) ,
390390 Math . round ( rescale ( greenLUT [ lutIndex ] , 0 , maxInput , 0 , maxOutput ) ) ,
@@ -399,7 +399,7 @@ class PaletteColorLookupTable {
399399 const normalizedPos = i / ( this [ _attrs ] . numberOfEntries - 1 )
400400 const gammaCorrectedPos = Math . pow ( normalizedPos , gammaInverse )
401401 const lutIndex = Math . round ( gammaCorrectedPos * ( this [ _attrs ] . numberOfEntries - 1 ) )
402-
402+
403403 this [ _attrs ] . data [ i ] = [ redLUT [ lutIndex ] , greenLUT [ lutIndex ] , blueLUT [ lutIndex ] ]
404404 }
405405 }
0 commit comments