This function really just unwraps the 'params' into better arguments and passes them to the actual img/array creation function
create_gradient_as_array(width, height, params, legend)image dimensions
geom parameters from ggplot
logical. TRUE if call comes during legend creation, otherwise FALSE.
RGBA array