title: create spectrum using kivy texture
body: <p>According to Kivy docs, this piece of code can be used to create a gradient from black and white. How does one create a spectrum using kivy textures?
  I've been trying manipulating the samples variables but all I got is a gradient between only two color. </p>
  
  <pre><code>texture = Texture.create(size=(64, 64))
  
  # create 64x64 rgb tab, and fill with values from 0 to 255
  # we'll have a gradient from black to white
  size = 64 * 64 * 3
  buf = [int(x * 255 / size) for x in range(size)]
  buf = b''.join(map(chr, buf))
  texture.blit_buffer(buf, colorfmt='rgb', bufferfmt='ubyte')
  with self.canvas:
      Rectangle(texture=texture, pos=self.pos, size=(64, 64))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tT2uu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tT2uu.png" alt="Something like this"></a></p>