def set_custom_color idx, red, green, blue
      raise 'Invalid format' if [red, green, blue].find { |c| ! (0..255).include?(c) }

      @palette[idx] = [red, green, blue]
    end
def set_custom_color idx, red, green, blue
      raise 'Invalid format' if [red, green, blue].find { |c| ! (0..255).include?(c) }

      @palette[idx] = [red, green, blue]
    end
Change the RGB components of the elements in the colour palette.