You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've been working on extending the functionality of this library and I've been designing a modern minimalist UI for it and what I'm working right now is adding the functionality of changing the color of an existing surface in the model group. I tried doing this:
GLmol.prototype.changePdbColor=function(id,color){varcurrentPDB=_.where(this.modelGroup.children,{name: id})[0];varnewColor;if(color.search('#')>=0){color=color.substring(1);// remove the pound # signcolor=parseInt(color,16);newColor=newTHREE.Color(color);}elseif(color.search('rgb')>=0){varcolorValues=color.substring(color.lastIndexOf("(")+1,color.lastIndexOf(")")).split(",");varr=parseInt(colorValues[0])/255;varg=parseInt(colorValues[1])/255;varb=parseInt(colorValues[2])/255;newColor=newTHREE.Color(r,g,b);}elseif(color.search('hsl')>=0){// TODO: finish thisvarcolorValues=color.substring(color.lastIndexOf("(")+1,color.lastIndexOf(")")).split(",");}currentPDB.children.forEach(function(child){child.material.color=newColor;});this.show();}
But all this does is just mess up the color and it doesn't really change it. How are you supposed to change the color?
The text was updated successfully, but these errors were encountered:
GLmol.prototype.changePdbColor=function(id,color){console.log("[GLmol][changePdbColor] beginning of function");varcurrentPDB=_.where(this.modelGroup.children,{name: id})[0];varcolorNew=newTCo(0x00FF00);// constant color for debugging purposescurrentPDB.children.forEach(function(child){child.children.forEach(function(inner_child){inner_child.geometry.colorAll(newColor);});});this.show();}
Hi, I've been working on extending the functionality of this library and I've been designing a modern minimalist UI for it and what I'm working right now is adding the functionality of changing the color of an existing surface in the model group. I tried doing this:
But all this does is just mess up the color and it doesn't really change it. How are you supposed to change the color?
The text was updated successfully, but these errors were encountered: