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

Let user choose colours #3

Closed matt-dray closed 1 year ago

matt-dray commented 2 years ago

By which I mean colours to pass to image() so the plot's pixels are shown with supplied colours.

This could mean users must supply either:

  1. A set of any colours whose length matches n_state
  2. A start and end colour, with interim colours being interpolated (e.g. the current default is a grey palette created with colorRampPalette())

Supplying a colour set for image() wouldn't result in those colours being provided in the output matrix (reasoning in #4). It's just simpler for the output to be coded as 0L:n_states.

Personally I'd like to use GameBoy colours for example (as per my RStudio theme, gamelad).

matt-dray commented 2 years ago

I like the conceptual simplicity of doing everything in greyscale; it suits my purpose for the package. I think it also limits the chance for confusion; some people might expect that the output matrix would have colour codes in it rather than zero-indexed consecutive integers.