palette
's correspondent type in the Stippe Effect source code is Palette
.
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.
P.colors() -> color{}
Returns a set of the colors in the palette P
.
P.included() -> color{}
Returns a set of the colors marked as "included" in the palette P
.
P.add_color(color c);
Adds the color c
to the palette P
.
Fails if P.colors().has(c)
P.remove_color(color c);
Removes the color c
from the palette P
if P
contains c
.
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)
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)