GetMaterialColor()

Syntax

Result = GetMaterialColor(#Material, Type)
Description
Get the specified material color.

Parameters

#Material The material to use.
Type The color type to get. It can be one of the following values:
  #PB_Material_AmbientColor:  the color used by default, without other lighting.
  #PB_Material_DiffuseColor:  the color the material will reflect when it will be dynamically lighted. 
                               For example, using a full white color will result at normal lighting (all colors 
                               are reflected). If you use a red, then only the red colors of the material will be 
                               reflected, resulting as a full red material (or black one, if the material doesn't
                               contain any red color).
  #PB_Material_SpecularColor: the color the material will reflect when it will be dynamically lighted by a light 
                               which has a specular color value. For example, using a full white color will result at 
                               normal lighting (all colors are reflected). If you use a red, then only the red colors 
                               of the material will be reflected, resulting as a full red material (or black one, if 
                               the material doesn't contain any red color).                
  #PB_Material_SelfIlluminationColor: the color the material will emit even if no light reach it.

Return value

Returns the RGB color value. Separate color channel value can easily be retrieved with Red(), Green() and Blue().

See Also

SetMaterialColor()

Supported OS

All

<- GetMaterialAttribute() - Material Index - GetScriptMaterial() ->