blackchicken Posted November 20, 2019 Share Posted November 20, 2019 Hello I`m stuck with setting correct color to nodes. I would like to set value with HSV. I want to do slight automatic gradient when I creating nodes in network box this one work in RGB: my_list = [nullA, nullB, nullC, nullD] loop = 0 nodePos = -1 for node in my_list: node.setColor(hou.Color(0.3, 0.5 * loop, 0.8)) node.setPosition(hou.Vector2(0, loop * nodePos)) loop += 1 but cant find the way how to set values with HSV, from doc should be something like this: my_list = [nullA, nullB, nullC, nullD] loop = 0 nodePos = -1 for node in my_list: node.setColor(hou.Color().setHSV(50, 0.5 * loop, 0.8)) node.setPosition(hou.Vector2(0, loop * nodePos)) loop += 1 Thanks for help, Jan Quote Link to comment Share on other sites More sharing options...
symek Posted November 20, 2019 Share Posted November 20, 2019 29 minutes ago, blackchicken said: my_list = [nullA, nullB, nullC, nullD] loop = 0 nodePos = -1 for node in my_list: node.setColor(hou.Color().setHSV(50, 0.5 * loop, 0.8)) node.setPosition(hou.Vector2(0, loop * nodePos)) loop += 1 hou.Color().setHSV expects a tuple of floats, not three floats: for node in nodes: color = hou.Color() hsv = (hou.hmath.rand(node.sessionId())*360, .9, .9) color.setHSV(hsv) node.setColor(color) Quote Link to comment Share on other sites More sharing options...
blackchicken Posted November 21, 2019 Author Share Posted November 21, 2019 Thanks a lot Symek, still soo much to learn Quote Link to comment Share on other sites More sharing options...
symek Posted November 21, 2019 Share Posted November 21, 2019 cheers! I feel it all the time Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.