title: How to store a Color in an unsigned char?
body: <p>I use openGL´s SOIL to load images and SOIL_load_image() returns an unsigned char*, which is then used by openGL to color all the width*height pixels. </p>
  
  <p>I would like to be able to pass my own unsigned char* to represent one single color. How do I represent color in a string/char*?</p>
  
  <p>This is what I am thinking about:</p>
  
  <pre><code>GLuint createTextureID(std::string texturePath) {
  
      int width, height;
      GLuint texID = 0;
      unsigned char* texData = nullptr;
  
      //currently, all my file paths begin with "..//"
      if (texturePath.at(0) != '.')
      {
          texData = texturePath.c_str();
          width = 1;
          height = 1;
      }
      else
      {
          texData = SOIL_load_image(texturePath.c_str(), &amp;width, &amp;height, 0, SOIL_LOAD_RGBA);
      }
  
      //UPLOAD texData TO OPENGL
  }
  </code></pre>