Skip to content

Commit bed348e

Browse files
authored
fix(🌈): enable wide gamut colors on RN Web (#3154)
1 parent 92c62fd commit bed348e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎packages/skia/src/views/SkiaBaseWebView.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export abstract class SkiaBaseWebView<
4242
canvas.width = this.width * pd;
4343
canvas.height = this.height * pd;
4444
const surface = CanvasKit.MakeWebGLCanvasSurface(canvas);
45+
const ctx = canvas.getContext("webgl2");
46+
if (ctx) {
47+
ctx.drawingBufferColorSpace = "display-p3";
48+
}
4549
if (!surface) {
4650
throw new Error("Could not create surface");
4751
}

0 commit comments

Comments
 (0)