Difference between revisions of "Color and Scripting"

From Second Life Wiki
Jump to: navigation, search
(added category flag for Text from In-world Notecards)
Line 54: Line 54:
FlipperPA Peregrine
FlipperPA Peregrine
[[Category:Text from In-world Notecards]]

Revision as of 11:30, 8 January 2007


Key words: colors colours rgb scripting

Using color in SL scripting is fairly easy. If works by combining values of red, green, and blue light. They are stored like this:

< Red Value, Green Value, Blue Value >

Each red, green, or blue value can be between 0 (no color saturation) to 1 (total color saturation). Remember, these values are determined by combining the colors as if they were light, not paint. Therefore, the combination of all three in total saturation is white:

<1,1,1> = white

The combination of all three with no saturday is black:

<0,0,0> = black

If there is not saturation on two values, and the third is saturated, you get a pure color:

<1,0,0> = red

<0,1,0> = green

<0,0,1> = blue

Mixing colors works as well:

<1,0.5,0> = orange

<0,1,1> = cyan (ice blue)

<1,0,0.5> = pink

<1,1,0.1> = yellow

<0.6,0,0.6> = purple

To convert frmo a web hex values, Just do a conversion. On the web:

FF = total saturation

00 = no saturation

00 on the web = 0 in Second Life

FF on the web = 1 in Second Life


FF00FF = <1,0,1>

I hope this card helps!

contributor: FlipperPA Peregrine