Hey all,
Working on a Python script, and I have a Random Color assigned to a new layer – but I’d like to be able to specify ranges of its HSV values (eg. Set a Pastel-type look with Saturation=15-25)
Thinking maybe I need to find a way to define the HSV of the color, and then convert to argb…?
Snippet of script below.
Thx,
Alan
#Create Random Color
def randomcolor():
red = int(255*random.random())
green = int(255*random.random())
blue = int(255*random.random())
return Color.FromArgb(red,green,blue)
#Define new layers (with names to be used throughout script)
bbox_layer_name = rs.AddLayer("bbox"+new_element, Color.FromArgb(20, 0, 0, 0), parent=new_element)
crv_layer_name = rs.AddLayer("crv"+new_element, Color.Red, parent=new_element)
sol_layer_name = rs.AddLayer("sol"+new_element, randomcolor(), parent=new_element)
8 posts - 5 participants