Skip to content

Commit 6ed62ba

Browse files
authored
Specify colors as sRGB-Rec709-D65 for color management. (#148)
1 parent 3234d5e commit 6ed62ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web-ifc-three/src/IFC/components/IFCParser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ export class IFCParser implements ParserAPI {
215215
return;
216216
}
217217

218-
const col = new Color(color.x, color.y, color.z);
218+
// Assume RGB components are in sRGB-Rec709-D65 colorspace, and specify
219+
// this so three.js can convert if THREE.ColorManagement APIs are enabled.
220+
// TODO: https://github.com/three-types/three-ts-types/issues/342
221+
const col = new Color().setRGB(color.x, color.y, color.z, 'srgb');
219222
const material = new MeshLambertMaterial({ color: col, side: DoubleSide });
220223
material.transparent = color.w !== 1;
221224
if (material.transparent) material.opacity = color.w;

0 commit comments

Comments
 (0)