User Tools

Site Tools


color

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
color [2017/08/14 09:26] – created justincolor [2021/04/21 20:24] (current) justin
Line 2: Line 2:
 ---- ----
  
-A **color** is a scripting data type that, as the name implies, represents an RGB color value and is written as //color[rgb]//. The The R, G, and B values correspond to the intensity of the red, green, and blue elements of the color and can range from 0 to 255.+A **color** is a scripting data type that represents an RGB color value and is written as either //color[RGB]// or //color["RRGGBB"]//. The R, G, and B values correspond to the intensity of the red, green, and blue elements of the color. When using the //color[R, G, B]// syntax, each parameter value should be an integer ranging from 0 to 255. When using the //color["RRGGBB"]// syntax, the "RRGGBB" string should be a valid six-character hexadecimal code ranging from "000000" (black) to "ffffff" (white).
  
-====Example:==== +====Examples:==== 
-<code lua>+<code bauxite>
 color[0, 0, 255] color[0, 0, 255]
 </code> </code>
 +<code bauxite>
 +color["0000ff"]
 +</code>
 +
 +The examples above both represent full intensity blue. The RGB values or six-character hexadecimal code can be taken from one of the built-in color pickers (for example, by editing a [[palette]] color on the [[Editor Tools]] tab), or from many common image editing applications like Microsoft Paint.
 +
 +When working in the visual [[Script Editor]], any function that has a color parameter will provide a color picker button in its visual node (as shown in the example below) that can be clicked on to select a color.
 +
 +{{:wiki:set_ambient_light_color_node.png?nolink|}}
  
-The example above represents full intensity blue.+The following scripting functions include a color parameter: 
 +  * [[Set Ambient Light Color]] 
 +  * [[Set Directional Light Color]] 
 +  * [[Set Entity Light Color]] 
 +  * [[Set Group Light Color]]
  
 ~~NOTOC~~ ~~NOTOC~~
color.1502727969.txt.gz · Last modified: 2017/08/14 09:26 by justin