Difference between revisions of "Category:LSL Color/pt"

From Second Life Wiki
Jump to navigation Jump to search
m (New page: {{Multi-lang}}{{LSL Header }}{{#vardefine:header_title|Cores na LSL }}{{#vardefine:header_text|A LSL tem o seu próprio formato de representação de cores. É usado um vector para reg...)
(No difference)

Revision as of 17:25, 28 January 2008

Cores na LSL

Cores na LSL

A LSL tem o seu próprio formato de representação de cores. É usado um vector para registar a cor. ao Contrário do formato RGB tradicional onde cada canal varia entre 0 -> 255, na LSL os canais de cor são 0 -> 1.

Format: <R, G, B>

• float x Red value [0, 1]
• float y Green value [0, 1]
• float z Blue value [0, 1]

Examples

<lsl> vector white = <1.0, 1.0, 1.0>; vector grey = <0.5, 0.5, 0.5>; vector black = <0.0, 0.0, 0.0>; vector red = <1.0, 0.0, 0.0>; vector green = <0.0, 1.0, 0.0>; vector blue = <0.0, 0.0, 1.0>; vector yellow = <1.0, 1.0, 0.0>; vector cyan = <0.0, 1.0, 1.0>; vector magenta = <1.0, 0.0, 1.0>;


</lsl>

Useful Snippets

Useful functions for storing/retrieving color and alpha values to/from integers

<lsl> integer ColorAlphatoRGBA(vector color, float alpha) { return (((integer)(alpha * 255.0) & 0xFF) << 24)

This category currently contains no pages or media.