Colordesc#

The Colordesc class holds the AI Vision Sensor Color Signatures. Colordesc objects are used to create Codedesc class objects or used directly with the AiVision class. Up to seven Color Signatures can be stored at once.

A Color Signature is created by using the following constructor:

Colordesc(index, red, green, blue, hangle, hdsat)

This constructor uses six parameters:

Parameter

Description

index

The Colordesc object’s index, from 1 - 7. Note: Creating two Colordesc objects with the same index number will cause the second created object to override the first.

red

The red value in the RGB color code.

green

The green value in the RGB color code.

blue

The blue value in the RGB color code.

hangle

The range of the allowable hue that will be detected as matching this Color Signature, from 1 - 40.

hdsat

The range of the allowable saturation that will be detected as matching this Color Signature, from 0.10 to 1.00.

# Create a new Color Signature "red" with the Colordesc class.
red = Colordesc(1, 207, 19, 25, 10.00, 0.20)

By default, the ALL_COLORS tag will return all Colordesc objects with the AI Vision Sensor.