refactored the __array__ and set_data to use (width, height) shape arrays.
made  get_color_index a public method.