matt-dray / pixeltrix

:space_invader::computer_mouse: R package: make pixel art interactively in a plot window, get a matrix, make a gif
Other
21 stars 0 forks source link

`edit_pixels()` not allowing for more `n_states` #25

Closed matt-dray closed 1 year ago

matt-dray commented 1 year ago

I wanted to edit y, which has three states, by adding a fourth state.

edit_pixels(y, n_states = 4, c("grey10", "lightgreen", "darkgreen", "white"))
# Error: Length of argument 'colours' should match the number of unique pixel states (3).

The length of the colours argument should be equal-to or more than n_states in y; in fact, I've specified it should now be 4 in the n_states argument.