PyMML Color

This is the PyMML Color class.

class color.Color(MC, cli)[source]

The Color class.

count_color(count, col, box, tol=0)[source]

Counts color col in box with tol. Yields integer of count.

find(box, color, tol=0)[source]

find a color in a box, with a specific tolerance. returns a tuple of the x, y value of a matched color. None if no color was found.

find_all(box, color, tol=0)[source]

find all colors in a box, with a specific tolerance. returned are all the matching points

find_area(col, box, min_a, tol=0)[source]

Finds a colored area in box with min area min_a with a specific tolerance. Yields a tuple of x, y values of found area.

find_spiral(col, box, tol=0)[source]

Find a color in a box, searching in the direction of a spiral, with a specific tolerance. Yields a tuple of x, y values of found color.

get(pt)[source]

Gets color at pt[0], pt[1]. Yields integer.

get_tolerance_speed()[source]

Gets CTS. Yields CTS.

get_tolerance_speed_2_modifiers()[source]

Gets CTS2 modifiers. Yields tuple of hue and sat mods.

set_tolerance_speed(ncts=0)[source]

Sets CTS to ncts.

set_tolerance_speed_2_modifiers(hue=0, sat=0)[source]

Sets CTS2 modifiers with hue, sat.

similar_colors(col1, col2, tol=0)[source]

Compares col1 and col2 with tol. Yields boolean