WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-31-2007, 02:10 PM
Vinicius Lima Vinicius Lima is offline
Member
 
Join Date: Jul 2007
Posts: 40
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
Reply With Quote
  #2  
Old 07-31-2007, 02:56 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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
Reply With Quote
  #3  
Old 07-31-2007, 02:58 PM
Vinicius Lima Vinicius Lima is offline
Member
 
Join Date: Jul 2007
Posts: 40
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.
Reply With Quote
  #4  
Old 07-31-2007, 03:31 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
If you need another color then you will need to define it yourself.
Reply With Quote
  #5  
Old 07-31-2007, 04:17 PM
Vinicius Lima Vinicius Lima is offline
Member
 
Join Date: Jul 2007
Posts: 40
Thanks!

Vinicius
Reply With Quote
  #6  
Old 01-21-2017, 07:37 AM
tianmoran tianmoran is offline
Member
 
Join Date: Nov 2016
Posts: 16
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?
Reply With Quote
  #7  
Old 01-23-2017, 01:18 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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])
You can press Alt + 1 in the Vizard editor to display a color dialog that inserts RGB values in the script for you.
Reply With Quote
  #8  
Old 01-25-2017, 11:58 AM
tianmoran tianmoran is offline
Member
 
Join Date: Nov 2016
Posts: 16
That's very helpful. Thanks!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC