Regular API function

simGetShapeColor / sim.getShapeColor

Description Retrieves the color of a shape. See also sim.setShapeColor.
C synopsis simInt simGetShapeColor(simInt shapeHandle,const simChar* colorName,simInt colorComponent,simFloat* rgbData)
C parameters
shapeHandle: handle of the shape
colorName: name of a color. If a name is provided, a specific color component will be retrieved (e.g. if a shape is a compound shape. Can be nullptr. If colorName is @compound, then rgb data for every component of a compound shape will be returned (in that case make sure to have enough space in rgbData, e.g. via sim.getObjectInt32Parameter(shapeHandle,sim.shapeintparam_component_cnt))
colorComponent: a color component.
rgbData (output): 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. 0 if the color name was not found in the shape. Otherwise, the operation was successful
Lua synopsis int result,table[3] rgbData=sim.getShapeColor(int shapeHandle,string colorName,int colorComponent)
Lua parameters
Similar to the C-function counterpart
Lua return values
Similar to the C-function counterpart