Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

web safe colors in the 0.0-1.0 format"

SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
10-04-2006 13:58
Unusual question someone else proposed in group chat:
"Does anyone have a list of colors in the 0.0-1.0 format (preferably the 140 web safe set)?"

well heck much to my surprise, someone answered that question, but it's too late to delete this post, so here is a link to the answer: /327/20/138429/1.html
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
10-04-2006 19:26
this isnt about web safe colors but along the same lines ... i use this widget instead of a list

CODE

vector float_color;

default
{
state_entry()
{
llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES); //set to blank
}

changed(integer ch)
{
if (ch & 2) // 2 = CHANGED_COLOR
{
float_color = llGetColor(ALL_SIDES);
llSetText("current color\n"+ (string)float_color,float_color,1);
llOwnerSay((string)float_color);
}
}
}


which gives you the full 16 million color spectrum within SL floating point... its pretty accurate when matching up textures with colored prims
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
10-04-2006 20:30
Easy trick when setting SL colours... don't bother with internal 0-1 range, instead of specifying 'normal' vector use:

( <r, g, b> / 255.0 )

where r, g and b are red, green and blue component in the usual 0-255 range supplied by any graphics program. Let the script do menial work, it's what it's for after all ;s
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
10-04-2006 20:39
im the oppsite i try to precalc as much as possible to save on the sim doing petty work :)
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
10-05-2006 00:26
Of course, the original question was web safe colors. The link provided does a bunch of different colors, I doubt all of which are web safe.

Web safe colors just use the following six numbers in each of the Red, Green, and Blue categories to form a variety of colors.
Hex = Dec = SL
00 = 0 = 0.0
33 = 51 = 0.2
66 = 102 = 0.4
99 = 153 = 0.6
CC = 204 = 0.8
FF = 255 = 1.0

So for Web Safe Colors (which I don't know why you're limiting it to them only in SL), use only 0.0 through 1.0 in steps of 0.2.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-05-2006 01:03
having re read the original post its a bit superflous but....

I have a palette of 142 colours that I've generated from a copy of a web-safe palette.
I use two scripts, a colour server (look up by name) and then a colour look up by index.
I dont have access to my scripts atm but If you're interested I'll post the code here later.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
10-05-2006 10:31
Uh... web-safe colors are so 1996. SL requires True Color displays, which can display all colors formed by an RGB triple with each number between 0 and 255 (or 0 and 1.0 for SL), so there's really nothing at all to be gained from picking colors that are "web-safe". For that matter, web-safe colors really don't matter for the WEB, either, because there aren't really any graphics adapters that don't run in true color mode anymore.

If you were just looking for a standard palette with corresponding SL color-vector values, then I apologize.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-06-2006 00:27
From: Lex Neva
Uh... web-safe colors are so 1996. SL requires True Color displays, which can display all colors formed by an RGB triple with each number between 0 and 255 (or 0 and 1.0 for SL), so there's really nothing at all to be gained from picking colors that are "web-safe". For that matter, web-safe colors really don't matter for the WEB, either, because there aren't really any graphics adapters that don't run in true color mode anymore.

If you were just looking for a standard palette with corresponding SL color-vector values, then I apologize.


I agree, my reason was to have a set of 'known' colours from which to choose. I didnt want to have to reinvent the (colour) wheel and decided exactly what rgb value constitutes dark maroon.
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
10-06-2006 10:25
Well, the standard system file rgb.txt that comes with X-windows installations has a pretty exhaustive list of color names and corresponding RGB triples. Maybe you can find a copy and write a quick program to translate them into color vectors? Here's an example of a chart made from rgb.txt.
Aakanaar LaSalle
Registered User
Join date: 1 Sep 2006
Posts: 132
10-06-2006 22:08
Converting those hex numbers into SL number (0.0 through 1.0) is easy..

All you have to do is seperate out the Red, Green and Blue values, so drop the '#' if it's up front, grab the next two characters for Red, the next two for Green, and the last two for Blue.

Then Convert them to decimal. (i've seen a function or two floating about that do this.)

And finally devide the decimal number by 255.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
10-22-2006 04:59
From: Joannah Cramer
Easy trick when setting SL colours... don't bother with internal 0-1 range, instead of specifying 'normal' vector use:

( <r, g, b> / 255.0 )

where r, g and b are red, green and blue component in the usual 0-255 range supplied by any graphics program. Let the script do menial work, it's what it's for after all ;s



From: Osgeld Barmy
im the oppsite i try to precalc as much as possible to save on the sim doing petty work


I'm with Osgeld, its optimisation at the easiest level.
Zeera Xi
Real Join Date: Mid '05
Join date: 21 Sep 2006
Posts: 54
10-22-2006 08:10
From: Aakanaar LaSalle
Converting those hex numbers into SL number (0.0 through 1.0) is easy..

All you have to do is seperate out the Red, Green and Blue values, so drop the '#' if it's up front, grab the next two characters for Red, the next two for Green, and the last two for Blue.

Then Convert them to decimal. (i've seen a function or two floating about that do this.)

And finally devide the decimal number by 255.


No no. There is an easier way.

Just typecast it from string.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
10-22-2006 11:50
255 typecasted is still 255, not much help when you need a value of 1