title: How to use hex color value in python reportlab pdf generation
body: <p>I am trying to generate multi page pdf document reading some <code>py</code> files and other doc files. I am trying do it with <code>SimpleDocTemplate</code> instead of <code>Canvas</code>. Now I am trying to color the text with hex value. I tried following:</p>
  
  <pre><code>from reportlab.lib.pagesizes import letter
  from reportlab.platypus import SimpleDocTemplate
  from reportlab.platypus.para import Paragraph
  from reportlab.lib.styles import getSampleStyleSheet
  
  doc_content = []
  styles=getSampleStyleSheet()
  
  doc = SimpleDocTemplate("form_letter.pdf",pagesize=letter,
                          rightMargin=72,leftMargin=72,
                          topMargin=72,bottomMargin=18)
  
  titleFormat = '&lt;font size="16" name="Helvetica" color="#FF8100"&gt;&lt;b&gt;&lt;i&gt;%s&lt;/i&gt;&lt;/b&gt;&lt;/font&gt;'
  
  def generateDoc(docName):
      paraTitle = Paragraph(titleFormat % 'Title', styles["Normal"])
      doc_content.append(paraTitle)
      doc.build(doc_content)
  
  generateDoc("temp.pdf")
  </code></pre>
  
  <p>But this gives me error </p>
  
  <pre><code>AttributeError: module 'reportlab.lib.colors' has no attribute '#FF8100'
  </code></pre>
  
  <p>I also tried <code>0xFF8100</code>, but it was giving same error:</p>
  
  <pre><code>AttributeError: module 'reportlab.lib.colors' has no attribute '0xFF8100'
  </code></pre>
  
  <p>When I use some named color say <code>red</code>, it works fine. How can use hex color values?</p>