< API

palette

palette objects created in scripts are internally represented by the Palette class from the Stipple Effect source code.


Functions

For an arbitrary palette object named P, functions of the form P.func_name(parameters) -> return_type are value-returning functions, while functions of the form P.func_name(parameters); are void functions, which perform an action but return nothing.

colors

P.colors() -> color{}

Returns a set of the colors in the palette P.

included

P.included() -> color{}

Returns a set of the colors marked as “included” in the palette P.

add_color

P.add_color(color c);

Adds the color c to the palette P.

Fails if P.colors().has(c)

remove_color

P.remove_color(color c);

Removes the color c from the palette P if P contains c.

move_color_left

P.move_color_left(color c);

Swaps the color c with the color to its left in the palette P if c is not the “leftmost” color in P.

Fails if !P.colors().has(c)

move_color_right

P.move_color_right(color c);

Swaps the color c with the color to its right in the palette P if c is not the “rightmost” color in P.

Fails if !P.colors().has(c)