SCROLL OF SCRIPT COLORS
Turns your RGB and Hex colors into LSL vector colors - no math required.
So many different ways to define one color! There's RGB, defined as values between 0 and 255 for red, green and blue, there's a hexadecimal color definition as used on Wikipedia's 'List of Colors' page, there's this, that and the other way, and if all that weren't enough, there's SL's LSL color definition as used in scripts.
Say you know enough about LSL scripting to make simple changes, like changing the color of particles. You know the color you want to change it to, but can't be bothered by the conversions needed to get the LSL coding for that color.
The 'Scroll of Script Colors' allows you to specify a color in several ways and then tell you the LSL equivilent, the color coding you would use in an LSL script. You can:
- Edit the Script Colors Prim from the package and select a color on SL's Edit window;
- Enter a color in RGB values that you got from a paint program;
- Enter a color in hexadecimal format that you took from Wikipedia's List of Colors page.
SELECT COLOR ON SL'S EDIT WINDOW:
The easiest method. Rez the object 'Harald's Script Color Prim' from the package, right-click it and select Edit. Change the color to your liking, close the Edit window and (left-)click the prim.
RGB COLOR FROM PAINT PROGRAM:
Most paint programs define colors as values for Red, Green and Blue (RGB), including SL's color picker. Rez the object 'Harald's Script Color Prim' and enter the color as RGB values, separated by a comma.
In chat -- Type "/3lsl r,g,b", where "r", "g" and "b" are the values for red, green and blue.
Example: /3 lsl 111,222,133
In a dialog box -- Click the cube for at least 2 seconds, then release the mouse button for a dialog text box. In that box enter the values for red, green and blue separated by commas and click the Send button (don't press Enter!)
Example: 111,222,133
HEXADECIMAL CODE FROM LIST OF COLORS:
The method is similar to entering the RGB values, except now you enter a pound sign and the 6 character hexadecimal representation of the color.
Chat example: /3 lsl #6fde85
Dialog text box example: #6fde85
You can find Wikipedia's List of Colors on the webpage http://en.wikipedia.org/wiki/List_of_colors
(takes a moment to load). Please note that the RGB values on that webpage are listed as percentages and not as values between 0 and 255. On that webpage, look in the column 'Hex triplet'.
THE RESULT:
The script will show the result as "LSL color vector: <x,y,z>", where "x", "y" and "z" are values between 0 and 1 for red, green and blue.
Example: LSL color vector: <0.435,0.870,0.521>
The result is optimized, meaning it has trailing zeroes cut off and each value shortened to 5 characters max (3 decimals max).
Copy the vector from chat history and paste it in the script, starting at the "<" and ending with the ">".
- Scripts for Dummies
- Get LSL color vectors of RGB/Hex colors
- Over 8 Years of LSL Scripting Experience