MaterialColor

Returns or modifies a material's diffuse color.  Material colors are represented as RGB colors.  An RGB color specifies the relative intensity of red, green, and blue to cause a specific color to be displayed.

Syntax

rhinoscriptsyntax.MaterialColor (material_index, color=None)

rhinoscript.material.MaterialColor (material_index, color=None)

Parameters

material_index

Required.  Number.  The zero-based source material index.

color

Optional.  Number.  The new color value.  If omitted, the current material color is returned.

Returns

Number

If color is not specified, the current material color if successful.

Number

If color is specified, the previous material color if successful.

None

It not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select object")

if obj:

    index = rs.ObjectMaterialIndex(obj)

    if index>-1:

        rs.MaterialColor( index, (127, 255, 191) )

Also See

MaterialBump

MaterialName

MaterialReflectiveColor

MaterialShine

MaterialTexture

MaterialTransparency