randomcolour / randomcolourr

An R package generating random colour examples across R functionality.
1 stars 0 forks source link

Generate a random colour #1

Closed mattmalin closed 5 years ago

mattmalin commented 5 years ago

This will be the core function for all example calls. Will want to optionally specify a random seed to start, and output formats for consumption in display formats.

First example should give either hex string or 255,255,255 style vector

mattmalin commented 5 years ago

First implementation will return just a hex string, with further return methods as part of #6

jn8 commented 5 years ago
  1. Should function colour exist before randomcolour?

  2. Should randomcolour be random_color?

3a. Should a parameter be included to introduce a bias, so that future demonstrations can be done on sampling distributions with color?

3b. Should there be a bias based on the individual parameters of a color (eg more red).

mattmalin commented 5 years ago
  1. since randomcolour is just producing a string, colour wouldn't do much as a precursor, but we could make a separate colour format "converter" called colour perhaps?

  2. I was also wondering the best to use. I've put in randomcolour withrandomcoloralias but was also thinkingrandom_colourandrandom_color` might be better. I was mainly aligning it with randomcolour.com but we could change it?

3a and 3b would be extensions :) currently I've just got copying randomcolour.com method which is uniform across the numeric versions of the colours, and can be controlled through the choice of RNG (it uses sample under the hood. I've got #5 around controlling random colour methods, with I think will be when to cover differ approaches, or different biases. There ends up being a large overlap with palette generation which does already have a wide set of packages existing already, so will probably draw from those I suspect rather than reinvent the wheel.

jn8 commented 5 years ago

Another thought for function naming rcol (a bit like rnorm)

jn8 commented 5 years ago
  1. It's nice to be consistent with the domain name

  2. The simplicity of the current solution is nice.

mattmalin commented 5 years ago

Another thought for function naming rcol (a bit like rnorm)

I like the consistency with the distribution functions for e.g. rnorm etc but rcol seems a bit too similar and confusing to some form of row/col operation.

mattmalin commented 5 years ago

This doesn't have to be the final form, as we can always alias or rename at some point when more functions start relying on it. Whichever function we keep as the primary call, I'll always include a randomcolour(...) wrapper call I'm sure for consistency with the domain.