Key2RGB

From Second Life Wiki
Revision as of 20:38, 31 March 2019 by Pazako Karu (talk | contribs) (Created page with "= key2RGB = Free to use in any context for any reason. Provided by Pazako Karu Convert a key to a color vector in RGB. Useful for assigning colors to specific avatars in a si...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

key2RGB

Free to use in any context for any reason. Provided by Pazako Karu

Convert a key to a color vector in RGB. Useful for assigning colors to specific avatars in a single direction.

Each key will generate a unique color specific to that key.

vector key2RGB(key input)
{
    integer intColor = llAbs((integer)("0x" + llGetSubString(llMD5String(input,0), 0, 7))); 
    return llVecNorm(<intColor%16777216, intColor%65536, intColor%256>); // 256^3, 256^2, 256^1
}