These forums are CLOSED. Please visit the new forums HERE
RGB Vectors |
|
Doasa Dassin
Registered User
Join date: 29 Aug 2005
Posts: 8
|
10-16-2005 13:07
I am working on a color changing script and looking for some pretty specific colors. As such, attempting random values is getting my nowhere fast. Does anyone know of a list of colors and there corresponding vector percentages?
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
10-16-2005 13:26
If your RGB colors are defined by values 0-255, you can divide your color values by 255 to get the 0.0-1.0 vectors needed for your script.
|
Doasa Dassin
Registered User
Join date: 29 Aug 2005
Posts: 8
|
10-16-2005 13:46
That is the problem. All the RGB tables I can find are in hexadecimal.
|
Kala Bijoux
Material Squirrel
Join date: 16 Nov 2004
Posts: 112
|
10-16-2005 14:14
The Windows calculator can do hex to decimal. Click on View and change it to Scientific. Then click the hex radio button, type in the hex value, click on the decimal button, and it'll give you the decimal value. You can also Google for "hex to decimal converter", there are dozens of websites that can do the conversion for you.
|
Blueman Steele
Registered User
Join date: 28 Dec 2004
Posts: 1,038
|
RGB help card
10-16-2005 15:46
Here is part of a help card I created on that subject.
Red and Green make YELLOW Green and Blue make CYAN Blue and Red make MAGENTA So lets start with Yellow which is Red and Green mixed together and list the 6 basic colors you can make just by turning off R, G, or B. <1, 1, 0> = YELLOW <0, 1, 0> = Green <0, 1, 1> = CYAN <0, 0, 1> = Blue <1, 0, 1> = MAGENTA <1, 0, 0> = Red Try cutting some in half to make more colors. < 0.5, 0, 0.5> = purple < 1, 0.5, 0> = orange < 1, 0.5, 0.5> = pink Experiment with finer increments to find browns and pale colors. Remember, dark colors will have low values in all 3 numbers and light colors will be high, or even 100% in paler colors. The more contrast between values, the more 'Pure' a color will be and the closer the 3 values are the more 'muted' or gray it will be. |
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
10-16-2005 16:33
Here's a function that should let you convert a hex RGB value to its vector value.
CODE vector getColorVector(integer hex) { This only works for values that take up the entire 32 bits of an integer. If you're running into colors that only use three bytes, 0xRRGGBB, then you'll need to slightly modify it: CODE
Hope this helps ![]() ==Chris _____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
|
Ushuaia Tokugawa
Nobody of Consequence
![]() Join date: 22 Mar 2005
Posts: 268
|
10-16-2005 16:38
_____________________
|
Fairge Kinsella
Gravity isn't so serious!
![]() Join date: 23 Oct 2004
Posts: 158
|
10-16-2005 16:52
There are a few ways to get the vectors for a colour, depending on what tools you have. Apologies, but I am limited to using Windows.
Using Paint to get RGB values for a colour Open Paint. In the Colours menu, select the Edit Colours option, this opens the Edit Colours dialog box. Click the Define Custom Colours Dialog box, this opens the colour picker. In the colour picker, select the colour you want to use. The Red, Green, and Blue fields display the RGB values for the selected colour. Convert the RGB to vector values as described below. Using Photoshop to get RGB value for a colour Open Photoshop. Click on the Foreground Colour display, this opens the Colour Picker. In the colour picker, select the colour you want to use. The R, G, and B fields display the RGB values for the selected colour. Convert the RGB to vector values as described below. Converting hex values to RGB using Photoshop Open Photoshop. Click on the Foreground Colour display, this opens the Colour Picker. In the # field, enter the hexadecimal value for the colour you want to use. The R, G, and B fields display the RGB values for the selected colour. Convert the RGB to vector values as described below. Converting hex values to RGB using Calculator A hexadecimal colour value uses two digits to specify each colour component. For example, for example, in #146B18 can be broken into Red: 14 Green: 6B, and Blue: 18. You need to convert each component to a decimal value separately. Open Calculator. In the View menu, select the Scientific option. This displays the larger scientific calculator. Select the Hex radio button. This enables the buttons for entering a hexadecimal digit. Enter the hex value for a colour component (for example,6B for the green above) Select the Dec radio button. This converts your entered value to a decimal. This this example, 107. 14 -> R: 20 6B -> G: 107 18 -> B:24 Convert the RGB to vector values as described below. Converting RGB 255 values to 1.0 values for a vector Each RGB colour component has a value between 0-255. To convert these to 0.0 vectors, divide each number by 255. I find that rounding to two decimal places is accurate enough. For example: (My favourite colour!) R:20 G:107 B:24 -> <0.08,0.42, 0.09> Hopefully that is helpful! Cheers, Fairge _____________________
Gravity Works - Drop balls with physics on - Dowden (25, 88) --- Gravitas - Available in green - Dowden (18, 206), Skyline Mall at Cass (80, 64), SL Boutique, SL Exchange |
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
10-17-2005 12:16
You can also use the built-in color picker to choose the color you want. Then just divide the red, green, and blue values by 255 to get the color vector.
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
10-17-2005 12:22
That is the problem. All the RGB tables I can find are in hexadecimal. The Windows calculator can convert between hex and decimal. Just set the view to 'Scientific'. Also, there are dozens of websites that can do this conversion for you. Google should be able to turn up a few. Search for "hex to decimal converter". |
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
10-24-2005 22:27
Wow...thanks everyone...great stuff.
I'll get it worked out ![]() _____________________
--AeonVox--
Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music. |