hex to rgb color

Discuss stuff not about Indigo.
Post Reply
8 posts • Page 1 of 1
byraul
Posts: 15
Joined: Mon May 21, 2007 11:01 am
Contact:

hex to rgb color

Post by byraul » Mon May 28, 2007 12:41 am

how can i convert a color from hex code (#ff00ff) to RGB vector?

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Mon May 28, 2007 1:30 am

split the hex into three parts, two characters each

ie. #FF00FF is
R - FF
G - 00
B - FF

then convert those parts to decimal

R - 255
G - 0
B - 255

User avatar
jurasek
Posts: 247
Joined: Sun Jun 25, 2006 11:23 pm
Location: Poland

Post by jurasek » Mon May 28, 2007 3:57 am

first link from google:

http://bontragerconnection.com/tools/co ... rter.shtml

greetz,
jur

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Mon May 28, 2007 5:05 am

you can use the calculator under Windows, switch to scientific mode in the menu:

Start > Run > calc
obsolete asset

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon May 28, 2007 7:32 am

or start -> Programs -> ___ (= Extras? In german, it's Zubehör...)

byraul
Posts: 15
Joined: Mon May 21, 2007 11:01 am
Contact:

Post by byraul » Mon May 28, 2007 9:40 am

hmm.. why blender exporter is creating RGB colours with values <1 ?
colour
Sets the RGB reflectance (albedo). All components should be in the range [0, 1)
Each component will be silently clamped to the range (after reverse gamma correction) [0, 0.9].
As of 0.7 test2, the RGB colour will be 'reverse gamma corrected' – all components will be
converted to display values by raising to the power of 2.2.
type: real 3-vector
restrictions: Each component should be in the range [0, 1)
units: dimensionless
From manual....

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Post by CTZn » Mon May 28, 2007 10:30 am

Then divide the result by 256 !
obsolete asset

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon May 28, 2007 11:37 am

exactly
very simple

If you maximum result is 255, but it SHALL be 1, just divide by 256 (the +1, 'cause of 0 also is a value)

Post Reply
8 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 26 guests