While working on my material, I decided to use the hex code 0x205081 like this:
material = new THREE.MeshBasicMaterial({color: 0x205081, vertexColors: THREE.FaceColors});
However, when I attempt to revert a few colors back to the original shade (0x205081) after making changes, it seems to be darker than its initial appearance. This happens even when using the exact same hex code. What am I doing wrong?
You can observe the disparity in this fiddle: http://jsfiddle.net/VsWb9/4805/
var camera, scene, renderer, geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 10000);
camera.position.z = 500;
scene.add(camera);
geometry = new THREE.CubeGeometry(200, 200, 200);
material = new THREE.MeshBasicMaterial({color: 0x205081, vertexColors: THREE.FaceColors});
mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
renderer = new THREE.CanvasRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
}
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
mesh.rotation.x += 0.01;
mesh.rotation.y += 0.02;
renderer.render(scene, camera);
}
$('input[type=button]').click( function() {
geometry.faces.map(function(f) {
f.color.setHex( 0x205081);
});
geometry.colorsNeedUpdate = true;
});