Regular API function

simSetShapeColor

Description Sets the color (or transforms it) of one or several shapes. See also simGetShapeColor.
C synopsis simInt simSetShapeColor(simInt shapeHandle,simChar* colorName,simInt colorComponent,simFloat* rgbData)
C parameters
shapeHandle: handle of the shape, or sim_handle_all if the command should be directed at all shapes
colorName: name of a color. Can be NULL, but if a name is provided, only shapes (or sub-entities of them) with a same color name will be modified. By specifying special names, the color can directly be transformed in the Hue-Saturation-Lightness (HSL) space:
"@0": all specified shape outside colors will be transformed such as: HSL={H+rgbData[0],S+rgbData[1],L+rgbData[2]}, where H operates in a cyclic manner.
"@1": all specified shape inside colors will be transformed such as: HSL={H+rgbData[0],S+rgbData[1],L+rgbData[2]}, where H operates in a cyclic manner.
"@2": all specified shape edge colors will be transformed such as: HSL={H+rgbData[0],S+rgbData[1],L+rgbData[2]}, where H operates in a cyclic manner.
colorComponent: a color component
rgbData: red, green and blue components of the color (3 values), or the transparency value (1 value)
C return value
-1 if operation was not successful. In a future release, a more differentiated return value might be available
Lua synopsis number result=simSetShapeColor(number shapeHandle,string colorName,number colorComponent,table_3 rgbData)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page