palette-shader 0.20.0 → 0.20.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palette-shader",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "Dependency-free WebGL2 shader that maps any colour palette across perceptual colour spaces — OKHsv, OKHsl, OKLCH and more.",
5
5
  "keywords": [
6
6
  "color",
@@ -107,8 +107,11 @@ export abstract class BasePaletteRenderer {
107
107
 
108
108
  this.canvasElement = document.createElement('canvas');
109
109
  this.canvasElement.classList.add(canvasClassName);
110
- const gl = this.canvasElement.getContext('webgl2');
110
+ const gl = this.canvasElement.getContext('webgl2', { antialias: false });
111
111
  if (!gl) throw new Error('WebGL2 not supported');
112
+ // Disable dithering so float→8-bit conversion is deterministic across
113
+ // drivers (matters for getColorAtUV readback; no visual cost for flat fills).
114
+ gl.disable(gl.DITHER);
112
115
  this.glContext = gl;
113
116
 
114
117
  this.paletteTexture = gl.createTexture()!;