title: using html5 input type='color'
body: <p>I have a model</p>
  <pre><code># models.py
  from django.db import models
      
  class Foo(models.Model):
      # ...
      color = models.CharField(max_length=7, null=True)
  </code></pre>
  <p><code>color</code> should store a hex-color. Instead of a <code>input type=&quot;text&quot;</code> I would like to use the <a href="http://www.w3schools.com/html/html5_form_input_types.asp" rel="noreferrer">html5 input type &quot;color&quot;</a>.</p>
  <p>I tried this by setting up the following form object:</p>
  <pre><code># forms.py
  from django.forms import ModelForm, CharField
  
  class FooForm(ModelForm):
      class Meta:
          model = Foo
          widgets = {
                     'color': CharField(attrs={'type': 'color'}),
                     }
  </code></pre>
  <p>However, this gives me the following error message</p>
  <blockquote>
  <p><strong>init</strong>() got an unexpected keyword argument 'attrs'</p>
  </blockquote>
  <p>What am I doing wrong and how would I do it right?</p>