ObjectColor

Returns or modifies the color of an object.  Object 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.ObjectColor (object_ids, color=None)

rhinoscript.object.ObjectColor (object_ids, color=None)

Parameters

object_ids

Required.  String, Guid, or List of Strings or Guids.  The identifier of the object(s).

color

Optional.  Number, list of 3 numbers.  The new color value.  If omitted, the current object color is returned.  Note, if object_ids is a list of objects, color is required.

Returns

Color

If a color value is not specified,  the current color value if successful.

Color

If a color value is specified, the previous color value if successful.

Number

If object_ids is a list, then the number of objects modified if successful.

Example

import rhinoscriptsyntax as rs

objs = rs.GetObjects("Select objects to change color")

if objs:

    color = rs.GetColor(0)

    if color:

        for obj in objs: rs.ObjectColor( obj, color )

Also See

ObjectColorSource

ObjectsByColor