Metadata-Version: 2.1
Name: django-colorinput
Version: 0.2
Summary: Color fields for Django models and forms using HTML5 native color type input elements
Home-page: https://github.com/der-gabe/django-colorinput
Author: Gabriel Niebler
Author-email: gabriel.niebler@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Framework :: Django
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/x-rst

=============================
django-colorinput
=============================

Color fields for forms and models using HTML5's native input element of type color.


Quickstart
----------

Install `django-colorinput` and add it to your `INSTALLED_APPS`:

.. code-block:: python

    INSTALLED_APPS = (
        …
        'colorinput.apps.ColorInputConfig',
        …
    )

Now you can use `ColorField` in your models:

.. code-block:: python

    from django.db import models

    from colorinput.models import ColorField

    class MyModel(models.Model):
        …
        color = ColorField(default="d0d0d0")
	…

In forms, the color field will be displayed using HTML5's native color type
input element. In your own templates, you could use the value stored in the
field like this:

.. code-block:: HTML

    <span style="color: #{{ object.color }}">

… or however you want, really. Just keep in mind that the value is stored as
RGB in triple HEX format *without* the leading "#" (hash symbol).


