#1
|
|||
|
|||
Colors
Hi,
I was working with Vizard and I tried to change the color of some objects throught the script but I am not sure how to name some colors. Is there any link where I could find the way Vizard labels hues? Thanks, Vinicius |
#2
|
|||
|
|||
Hi,
Vizard uses RGB to specify color values. Each component is specified with a value between 0 and 1. Here is a link to the Wikipedia page on RGB: http://en.wikipedia.org/wiki/RGB |
#3
|
|||
|
|||
Thanks, I've figured that out already. My problem is that sometimes colors have names like SKYBLUE and I don't know how exactly the other RGB colors are called.
|
#4
|
|||
|
|||
Hi,
Vizard defines some common color values. Here are the names and values: Code:
WHITE = (1,1,1) BLACK = (0,0,0) GRAY = (0.5,0.5,0.5) RED = (1,0,0) GREEN = (0,1,0) BLUE = (0,0,1) YELLOW = (1,1,0) ORANGE = (1,0.5,0) PURPLE = (0.5,0,0.5) SKYBLUE = (0.5,0.5,1) |
#5
|
|||
|
|||
Thanks!
Vinicius |
#6
|
|||
|
|||
Hi, I have a further question. How do I map a color in Vizard, like (0.5,0.5,0.5) gray, to a color represented by 8-bit? Is it (128,128,128) in the example?
|
#7
|
|||
|
|||
Yes, the following code will apply that color to a box:
Code:
import viz import vizact viz.go() import vizshape box = vizshape.addBox(pos=[0,1.8,4]) vizact.onkeydown(' ',box.color,[0.5,0.5,0.5]) |
#8
|
|||
|
|||
That's very helpful. Thanks!
|
|
|