Forráskód Böngészése

ColorManagement: Enable by default (#25866)

* ColorManagement: Enable by default

* Update unit tests.
Don McCurdy 2 éve
szülő
commit
e284aeefc7

+ 1 - 1
src/math/ColorManagement.js

@@ -67,7 +67,7 @@ const FROM_LINEAR = {
 
 
 export const ColorManagement = {
 export const ColorManagement = {
 
 
-	enabled: false,
+	enabled: true,
 
 
 	get legacyMode() {
 	get legacyMode() {
 
 

+ 109 - 0
test/unit/src/math/Color.tests.js

@@ -21,6 +21,8 @@ export default QUnit.module( 'Maths', () => {
 		// INSTANCING
 		// INSTANCING
 		QUnit.test( 'Instancing', ( assert ) => {
 		QUnit.test( 'Instancing', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			// default ctor
 			// default ctor
 			let c = new Color();
 			let c = new Color();
 			assert.ok( c.r, 'Red: ' + c.r );
 			assert.ok( c.r, 'Red: ' + c.r );
@@ -38,6 +40,9 @@ export default QUnit.module( 'Maths', () => {
 		// EXPOSED CONSTANTS
 		// EXPOSED CONSTANTS
 		QUnit.test( 'Color.NAMES', ( assert ) => {
 		QUnit.test( 'Color.NAMES', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
+
 			assert.ok( Color.NAMES.aliceblue == 0xF0F8FF, 'Exposed Color.NAMES' );
 			assert.ok( Color.NAMES.aliceblue == 0xF0F8FF, 'Exposed Color.NAMES' );
 
 
 		} );
 		} );
@@ -45,6 +50,8 @@ export default QUnit.module( 'Maths', () => {
 		// PUBLIC STUFF
 		// PUBLIC STUFF
 		QUnit.test( 'isColor', ( assert ) => {
 		QUnit.test( 'isColor', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color();
 			const a = new Color();
 			assert.ok( a.isColor === true, 'Passed!' );
 			assert.ok( a.isColor === true, 'Passed!' );
 
 
@@ -55,6 +62,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'set', ( assert ) => {
 		QUnit.test( 'set', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color();
 			const a = new Color();
 			const b = new Color( 0.5, 0, 0 );
 			const b = new Color( 0.5, 0, 0 );
 			const c = new Color( 0xFF0000 );
 			const c = new Color( 0xFF0000 );
@@ -73,6 +82,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setScalar', ( assert ) => {
 		QUnit.test( 'setScalar', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setScalar( 0.5 );
 			c.setScalar( 0.5 );
 			assert.ok( c.r == 0.5, 'Red: ' + c.r );
 			assert.ok( c.r == 0.5, 'Red: ' + c.r );
@@ -83,6 +94,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setHex', ( assert ) => {
 		QUnit.test( 'setHex', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setHex( 0xFA8072 );
 			c.setHex( 0xFA8072 );
 			assert.ok( c.getHex() == 0xFA8072, 'Hex: ' + c.getHex() );
 			assert.ok( c.getHex() == 0xFA8072, 'Hex: ' + c.getHex() );
@@ -126,6 +139,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setHSL', ( assert ) => {
 		QUnit.test( 'setHSL', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const hsl = { h: 0, s: 0, l: 0 };
 			const hsl = { h: 0, s: 0, l: 0 };
 			c.setHSL( 0.75, 1.0, 0.25 );
 			c.setHSL( 0.75, 1.0, 0.25 );
@@ -139,6 +154,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyle', ( assert ) => {
 		QUnit.test( 'setStyle', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color();
 			const a = new Color();
 
 
 			let b = new Color( 8 / 255, 25 / 255, 178 / 255 );
 			let b = new Color( 8 / 255, 25 / 255, 178 / 255 );
@@ -182,6 +199,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setColorName', ( assert ) => {
 		QUnit.test( 'setColorName', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const res = c.setColorName( 'aliceblue' );
 			const res = c.setColorName( 'aliceblue' );
 
 
@@ -192,6 +211,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'clone', ( assert ) => {
 		QUnit.test( 'clone', ( assert ) => {
 
 
+
+			ColorManagement.enabled = false; // TODO: Update and enable.
 			const c = new Color( 'teal' );
 			const c = new Color( 'teal' );
 			const c2 = c.clone();
 			const c2 = c.clone();
 			assert.ok( c2.getHex() == 0x008080, 'Hex c2: ' + c2.getHex() );
 			assert.ok( c2.getHex() == 0x008080, 'Hex c2: ' + c2.getHex() );
@@ -200,6 +221,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'copy', ( assert ) => {
 		QUnit.test( 'copy', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 'teal' );
 			const a = new Color( 'teal' );
 			const b = new Color();
 			const b = new Color();
 			b.copy( a );
 			b.copy( a );
@@ -211,6 +234,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'copySRGBToLinear', ( assert ) => {
 		QUnit.test( 'copySRGBToLinear', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const c2 = new Color();
 			const c2 = new Color();
 			c2.setRGB( 0.3, 0.5, 0.9 );
 			c2.setRGB( 0.3, 0.5, 0.9 );
@@ -223,6 +248,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'copyLinearToSRGB', ( assert ) => {
 		QUnit.test( 'copyLinearToSRGB', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const c2 = new Color();
 			const c2 = new Color();
 			c2.setRGB( 0.09, 0.25, 0.81 );
 			c2.setRGB( 0.09, 0.25, 0.81 );
@@ -235,6 +262,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'convertSRGBToLinear', ( assert ) => {
 		QUnit.test( 'convertSRGBToLinear', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setRGB( 0.3, 0.5, 0.9 );
 			c.setRGB( 0.3, 0.5, 0.9 );
 			c.convertSRGBToLinear();
 			c.convertSRGBToLinear();
@@ -246,6 +275,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'convertLinearToSRGB', ( assert ) => {
 		QUnit.test( 'convertLinearToSRGB', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setRGB( 4, 9, 16 );
 			c.setRGB( 4, 9, 16 );
 			c.convertLinearToSRGB();
 			c.convertLinearToSRGB();
@@ -257,6 +288,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'getHex', ( assert ) => {
 		QUnit.test( 'getHex', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color( 'red' );
 			const c = new Color( 'red' );
 			const res = c.getHex();
 			const res = c.getHex();
 			assert.ok( res == 0xFF0000, 'Hex: ' + res );
 			assert.ok( res == 0xFF0000, 'Hex: ' + res );
@@ -265,6 +298,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'getHexString', ( assert ) => {
 		QUnit.test( 'getHexString', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color( 'tomato' );
 			const c = new Color( 'tomato' );
 			const res = c.getHexString();
 			const res = c.getHexString();
 			assert.ok( res == 'ff6347', 'Hex: ' + res );
 			assert.ok( res == 'ff6347', 'Hex: ' + res );
@@ -273,6 +308,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'getHSL', ( assert ) => {
 		QUnit.test( 'getHSL', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color( 0x80ffff );
 			const c = new Color( 0x80ffff );
 			const hsl = { h: 0, s: 0, l: 0 };
 			const hsl = { h: 0, s: 0, l: 0 };
 			c.getHSL( hsl );
 			c.getHSL( hsl );
@@ -323,6 +360,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'offsetHSL', ( assert ) => {
 		QUnit.test( 'offsetHSL', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 'hsl(120,50%,50%)' );
 			const a = new Color( 'hsl(120,50%,50%)' );
 			const b = new Color( 0.36, 0.84, 0.648 );
 			const b = new Color( 0.36, 0.84, 0.648 );
 
 
@@ -336,6 +375,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'add', ( assert ) => {
 		QUnit.test( 'add', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0x0000FF );
 			const a = new Color( 0x0000FF );
 			const b = new Color( 0xFF0000 );
 			const b = new Color( 0xFF0000 );
 			const c = new Color( 0xFF00FF );
 			const c = new Color( 0xFF00FF );
@@ -348,6 +389,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'addColors', ( assert ) => {
 		QUnit.test( 'addColors', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0x0000FF );
 			const a = new Color( 0x0000FF );
 			const b = new Color( 0xFF0000 );
 			const b = new Color( 0xFF0000 );
 			const c = new Color( 0xFF00FF );
 			const c = new Color( 0xFF00FF );
@@ -362,6 +405,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'addScalar', ( assert ) => {
 		QUnit.test( 'addScalar', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0.1, 0.0, 0.0 );
 			const a = new Color( 0.1, 0.0, 0.0 );
 			const b = new Color( 0.6, 0.5, 0.5 );
 			const b = new Color( 0.6, 0.5, 0.5 );
 
 
@@ -373,6 +418,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'sub', ( assert ) => {
 		QUnit.test( 'sub', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0x0000CC );
 			const a = new Color( 0x0000CC );
 			const b = new Color( 0xFF0000 );
 			const b = new Color( 0xFF0000 );
 			const c = new Color( 0x0000AA );
 			const c = new Color( 0x0000AA );
@@ -387,6 +434,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'multiply', ( assert ) => {
 		QUnit.test( 'multiply', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 1, 0, 0.5 );
 			const a = new Color( 1, 0, 0.5 );
 			const b = new Color( 0.5, 1, 0.5 );
 			const b = new Color( 0.5, 1, 0.5 );
 			const c = new Color( 0.5, 0, 0.25 );
 			const c = new Color( 0.5, 0, 0.25 );
@@ -398,6 +447,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'multiplyScalar', ( assert ) => {
 		QUnit.test( 'multiplyScalar', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0.25, 0, 0.5 );
 			const a = new Color( 0.25, 0, 0.5 );
 			const b = new Color( 0.5, 0, 1 );
 			const b = new Color( 0.5, 0, 1 );
 
 
@@ -408,6 +459,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'lerp', ( assert ) => {
 		QUnit.test( 'lerp', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const c2 = new Color();
 			const c2 = new Color();
 			c.setRGB( 0, 0, 0 );
 			c.setRGB( 0, 0, 0 );
@@ -434,6 +487,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'equals', ( assert ) => {
 		QUnit.test( 'equals', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0.5, 0.0, 1.0 );
 			const a = new Color( 0.5, 0.0, 1.0 );
 			const b = new Color( 0.5, 1.0, 0.0 );
 			const b = new Color( 0.5, 1.0, 0.0 );
 
 
@@ -456,6 +511,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'fromArray', ( assert ) => {
 		QUnit.test( 'fromArray', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color();
 			const a = new Color();
 			const array = [ 0.5, 0.6, 0.7, 0, 1, 0 ];
 			const array = [ 0.5, 0.6, 0.7, 0, 1, 0 ];
 
 
@@ -473,6 +530,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'toArray', ( assert ) => {
 		QUnit.test( 'toArray', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const r = 0.5, g = 1.0, b = 0.0;
 			const r = 0.5, g = 1.0, b = 0.0;
 			const a = new Color( r, g, b );
 			const a = new Color( r, g, b );
 
 
@@ -505,6 +564,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'toJSON', ( assert ) => {
 		QUnit.test( 'toJSON', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const a = new Color( 0.0, 0.0, 0.0 );
 			const a = new Color( 0.0, 0.0, 0.0 );
 			const b = new Color( 0.0, 0.5, 0.0 );
 			const b = new Color( 0.0, 0.5, 0.0 );
 			const c = new Color( 1.0, 0.0, 0.0 );
 			const c = new Color( 1.0, 0.0, 0.0 );
@@ -520,6 +581,8 @@ export default QUnit.module( 'Maths', () => {
 		// OTHERS - FUNCTIONAL
 		// OTHERS - FUNCTIONAL
 		QUnit.test( 'copyHex', ( assert ) => {
 		QUnit.test( 'copyHex', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const c2 = new Color( 0xF5FFFA );
 			const c2 = new Color( 0xF5FFFA );
 			c.copy( c2 );
 			c.copy( c2 );
@@ -529,6 +592,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'copyColorString', ( assert ) => {
 		QUnit.test( 'copyColorString', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			const c2 = new Color( 'ivory' );
 			const c2 = new Color( 'ivory' );
 			c.copy( c2 );
 			c.copy( c2 );
@@ -538,6 +603,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setWithNum', ( assert ) => {
 		QUnit.test( 'setWithNum', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.set( 0xFF0000 );
 			c.set( 0xFF0000 );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -548,6 +615,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setWithString', ( assert ) => {
 		QUnit.test( 'setWithString', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.set( 'silver' );
 			c.set( 'silver' );
 			assert.ok( c.getHex() == 0xC0C0C0, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0xC0C0C0, 'Hex c: ' + c.getHex() );
@@ -556,6 +625,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBRed', ( assert ) => {
 		QUnit.test( 'setStyleRGBRed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'rgb(255,0,0)' );
 			c.setStyle( 'rgb(255,0,0)' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -566,6 +637,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBARed', ( assert ) => {
 		QUnit.test( 'setStyleRGBARed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -580,6 +653,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBRedWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleRGBRedWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'rgb( 255 , 0,   0 )' );
 			c.setStyle( 'rgb( 255 , 0,   0 )' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -590,6 +665,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBARedWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleRGBARedWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'rgba( 255,  0,  0  , 1 )' );
 			c.setStyle( 'rgba( 255,  0,  0  , 1 )' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -600,6 +677,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBPercent', ( assert ) => {
 		QUnit.test( 'setStyleRGBPercent', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'rgb(100%,50%,10%)' );
 			c.setStyle( 'rgb(100%,50%,10%)' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -610,6 +689,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBAPercent', ( assert ) => {
 		QUnit.test( 'setStyleRGBAPercent', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -624,6 +705,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBPercentWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleRGBPercentWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'rgb( 100% ,50%  , 10% )' );
 			c.setStyle( 'rgb( 100% ,50%  , 10% )' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -634,6 +717,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleRGBAPercentWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleRGBAPercentWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -648,6 +733,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLRed', ( assert ) => {
 		QUnit.test( 'setStyleHSLRed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'hsl(360,100%,50%)' );
 			c.setStyle( 'hsl(360,100%,50%)' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -658,6 +745,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLARed', ( assert ) => {
 		QUnit.test( 'setStyleHSLARed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -672,6 +761,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLRedWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleHSLRedWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'hsl(360,  100% , 50% )' );
 			c.setStyle( 'hsl(360,  100% , 50% )' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -682,6 +773,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLARedWithSpaces', ( assert ) => {
 		QUnit.test( 'setStyleHSLARedWithSpaces', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -696,6 +789,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLRedWithDecimals', ( assert ) => {
 		QUnit.test( 'setStyleHSLRedWithDecimals', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'hsl(360,100.0%,50.0%)' );
 			c.setStyle( 'hsl(360,100.0%,50.0%)' );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
 			assert.ok( c.r == 1, 'Red: ' + c.r );
@@ -706,6 +801,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHSLARedWithDecimals', ( assert ) => {
 		QUnit.test( 'setStyleHSLARedWithDecimals', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 
 
 			console.level = CONSOLE_LEVEL.ERROR;
 			console.level = CONSOLE_LEVEL.ERROR;
@@ -720,6 +817,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHexSkyBlue', ( assert ) => {
 		QUnit.test( 'setStyleHexSkyBlue', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( '#87CEEB' );
 			c.setStyle( '#87CEEB' );
 			assert.ok( c.getHex() == 0x87CEEB, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0x87CEEB, 'Hex c: ' + c.getHex() );
@@ -728,6 +827,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHexSkyBlueMixed', ( assert ) => {
 		QUnit.test( 'setStyleHexSkyBlueMixed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( '#87cEeB' );
 			c.setStyle( '#87cEeB' );
 			assert.ok( c.getHex() == 0x87CEEB, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0x87CEEB, 'Hex c: ' + c.getHex() );
@@ -736,6 +837,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHex2Olive', ( assert ) => {
 		QUnit.test( 'setStyleHex2Olive', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( '#F00' );
 			c.setStyle( '#F00' );
 			assert.ok( c.getHex() == 0xFF0000, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0xFF0000, 'Hex c: ' + c.getHex() );
@@ -744,6 +847,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleHex2OliveMixed', ( assert ) => {
 		QUnit.test( 'setStyleHex2OliveMixed', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( '#f00' );
 			c.setStyle( '#f00' );
 			assert.ok( c.getHex() == 0xFF0000, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0xFF0000, 'Hex c: ' + c.getHex() );
@@ -752,6 +857,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'setStyleColorName', ( assert ) => {
 		QUnit.test( 'setStyleColorName', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color();
 			const c = new Color();
 			c.setStyle( 'powderblue' );
 			c.setStyle( 'powderblue' );
 			assert.ok( c.getHex() == 0xB0E0E6, 'Hex c: ' + c.getHex() );
 			assert.ok( c.getHex() == 0xB0E0E6, 'Hex c: ' + c.getHex() );
@@ -760,6 +867,8 @@ export default QUnit.module( 'Maths', () => {
 
 
 		QUnit.test( 'iterable', ( assert ) => {
 		QUnit.test( 'iterable', ( assert ) => {
 
 
+			ColorManagement.enabled = false; // TODO: Update and enable.
+
 			const c = new Color( 0.5, 0.75, 1 );
 			const c = new Color( 0.5, 0.75, 1 );
 			const array = [ ...c ];
 			const array = [ ...c ];
 			assert.strictEqual( array[ 0 ], 0.5, 'Color is iterable.' );
 			assert.strictEqual( array[ 0 ], 0.5, 'Color is iterable.' );

+ 4 - 4
test/unit/src/math/ColorManagement.tests.js

@@ -12,8 +12,8 @@ export default QUnit.module( 'Maths', () => {
 		QUnit.test( 'enabled', ( assert ) => {
 		QUnit.test( 'enabled', ( assert ) => {
 
 
 			assert.strictEqual(
 			assert.strictEqual(
-				ColorManagement.enabled, false,
-				'ColorManagement.enabled is false by default.'
+				ColorManagement.enabled, true,
+				'ColorManagement.enabled is true by default.'
 			);
 			);
 
 
 		} );
 		} );
@@ -24,12 +24,12 @@ export default QUnit.module( 'Maths', () => {
 			// THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.
 			// THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150.
 
 
 			console.level = CONSOLE_LEVEL.OFF;
 			console.level = CONSOLE_LEVEL.OFF;
-			const expected = ColorManagement.legacyMode === true;
+			const expected = ColorManagement.legacyMode === false;
 			console.level = CONSOLE_LEVEL.DEFAULT;
 			console.level = CONSOLE_LEVEL.DEFAULT;
 
 
 			assert.ok(
 			assert.ok(
 				expected,
 				expected,
-				'ColorManagement.legacyMode is true by default.'
+				'ColorManagement.legacyMode is false by default.'
 			);
 			);
 
 
 		} );
 		} );