Skip to main content

Provides an colorpicker field for use in Django models

Project description


Provides an colorpicker field for use in Django models.



  • django >= 1.11
  • python >= 3.4


Install django-spectrum:

pip install django-spectrum

Add it to your INSTALLED_APPS list:


Then add it to your models:

from spectrum.fields import ColorField

class MyModel(models.Model):
    color = ColorField(_('color'), default='#FFFF00')

Color instance

>>> from spectrum.color import Color

>>> rgb_color = Color('#FFFF00')
>>> print(rgb_color)

>>> rgba_color = Color('#FFFF00', 0.5)
>>> print(rgba_color)

>>> print(rgba_color.hex_code)

>>> print(rgba_color.hex)

>>> print(rgba_color.opacity)


Copyright (c) 2018 Mihail Mishakin Released under the BSD license (see LICENSE)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-spectrum, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_spectrum-0.1.0-py2.py3-none-any.whl (31.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-spectrum-0.1.0.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page