Skip to content

Commit 0321aa7

Browse files
authored
Use srgb output in the svg example (#23280)
1 parent f9a5a96 commit 0321aa7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/webgl_loader_svg.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
renderer = new THREE.WebGLRenderer( { antialias: true } );
5959
renderer.setPixelRatio( window.devicePixelRatio );
6060
renderer.setSize( window.innerWidth, window.innerHeight );
61+
renderer.outputEncoding = THREE.sRGBEncoding;
6162
container.appendChild( renderer.domElement );
6263

6364
//
@@ -169,7 +170,7 @@
169170
if ( guiData.drawFillShapes && fillColor !== undefined && fillColor !== 'none' ) {
170171

171172
const material = new THREE.MeshBasicMaterial( {
172-
color: new THREE.Color().setStyle( fillColor ),
173+
color: new THREE.Color().setStyle( fillColor ).convertSRGBToLinear(),
173174
opacity: path.userData.style.fillOpacity,
174175
transparent: true,
175176
side: THREE.DoubleSide,
@@ -197,7 +198,7 @@
197198
if ( guiData.drawStrokes && strokeColor !== undefined && strokeColor !== 'none' ) {
198199

199200
const material = new THREE.MeshBasicMaterial( {
200-
color: new THREE.Color().setStyle( strokeColor ),
201+
color: new THREE.Color().setStyle( strokeColor ).convertSRGBToLinear(),
201202
opacity: path.userData.style.strokeOpacity,
202203
transparent: true,
203204
side: THREE.DoubleSide,

0 commit comments

Comments
 (0)