title: Python - How to check if string is a HEX Color Code
body: <p>I need your help!</p>
  
  <p>Im kinda new whats regarding python and "hex".</p>
  
  <p>I have a site where people can enter their own HEX-Color for their messages.</p>
  
  <p>So currently i have everything built in except the "isHEXColor" Check..</p>
  
  <p>I realy dont know how i can be sure that the user gave a valid HEX-Color-Code.</p>
  
  <p>Currently im just checking if the len is 6 digits, nothing more.</p>
  
  <pre><code>if not len(color) == 6: return error("HEX-Color" must contain 6 characters")
  </code></pre>
  
  <p>Can you might help me?
  And it should work for Python 2.5!</p>