Working on a project in Three.js, and the RGB values I get back don’t seem to correlate with the on screen graphics as they should.
I set a material like this:
var planeMaterial = new THREE.MeshBasicMaterial({ color: 0x00ff00, vertexColors: THREE.FaceColors });
Apply it to a plane geometry, and then later change it with this:
face.color.setHSL(0, 0, 0.0)
Then repeatedly later change it with
face.color.offsetHSL(0, 0, 0.1)
The colors do in fact go from black to green, but then will not continue on and tend towards white. Looking at the RBG values, they then tell me that the color values are equal to:
Color {b: 1, g: 1, r: 1}
and using getHSL it says:
{h: 0, s: 0, l: 1}
Yet the plane is very clearly green, and not white. I’m obviously missing something big about how colors work here, but I cant for the life of me make heads or tails of this. Can anyone see what I’m doing wrong? Thanks inadvance.
Yeah you can see in my fiddle I had that colorsNeedUpdate set to true, but forgot to re-comment it back in. What I should have posted is the same as your solution, but it doesnt fix my problem. you can see from the fiddle from @Mugen87 That it should be going Black -> Green -> White, but instead it only goes Black -> Green, despite using the same code. THAT is my problem.
The only difference is one is being applied to the material, and the other to a face of that material. I cant understand why One goes Black -> Green -> White, and the other only goes Black -> Green. I’m basically just trying to control the complete brightness of a face, but I can only control the darkness it seems.
I need to modify brightness on a face by face basis, without having to resort to removing all color.