title: Is there a better way to create a color picker in Unity C# and NGUI?
body: <p>I am creating a bit of an art program / game in Unity, however I need to create a color picker for the artists who are building things inside it. I am using the NGUI UI system, and I've created a basic sprite with a set of colors on it, along with a custom color input. </p>
  
  <p>However, actually selecting one of those colors accurately is not proving easy. 
  I'm currently doing it like this:</p>
  
  <pre><code>IEnumerator CaptureTempArea()
  {
      yield return new WaitForEndOfFrame();
  
      tex = new Texture2D(Screen.width, Screen.height);
      tex.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
      tex.Apply();
  
  
      Vector2 pos = UICamera.lastEventPosition;
  
      int x = (int)pos.x;
  
      int y = (int)pos.y;
  
      Color color = tex.GetPixel(x, y);
  
      Debug.Log(ColorToHex(color));
  
      Debug.Log(tex.GetRawTextureData().Length / 1000);
  
      Destroy(tex);
      tex = null;
  }
  </code></pre>
  
  <p>However, there must be a better way to capture -just- the specific area. This does accurately get the colors, however. But it also generates an image - even temporary - that is anywhere from 2 to 8 MB in size before it gets cleared from the buffer. Given the specific UI system, is there a better way to create a color picker, or one that will use less memory?</p>