Skip to main content

An extension to the Django web framework that provides database and form color fields

Project description

An extension to the Django web framework that provides a database and form field to accept and store colors in the RGB format.

https://travis-ci.org/charettes/django-colorful.svg?branch=master https://coveralls.io/repos/charettes/django-colorful/badge.svg?branch=master&service=github

Installation

>>> pip install django-colorful

Make sure 'colorful' is in your INSTALLED_APPS:

INSTALLED_APPS.append('colorful')

Usage

In order to use a color field you just have to add it to your model definition:

from django.db import models
from colorful.fields import RGBColorField

class Tag(models.Model):
    color = RGBColorField()

The RGBColorField class also accepts a color keyword argument which can be set to a list of colors that should be visible as preset color palette:

color = RGBColorField(colors=['#FF0000', '#00FF00', '#0000FF'])

The ColorFieldWidget should take care of providing a JavaScript based shim on browsers that don’t support the HTML5 color input.

Download files

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

Source Distribution

django-colorful-scybear-1.2.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

django_colorful_scybear-1.2.1-py2.py3-none-any.whl (10.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-colorful-scybear-1.2.1.tar.gz.

File metadata

  • Download URL: django-colorful-scybear-1.2.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django-colorful-scybear-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5ec119b810bd6d6ca991353c6fad878b49ac87cd4b6399eb2d05ba0f25ddfda9
MD5 42a4d9cddd1df7facba6c2518b4c48da
BLAKE2b-256 a6ec0b08fcb30f48889c9cb45edbf9d467e257cb43f182ba27e766ac07f25a8b

See more details on using hashes here.

File details

Details for the file django_colorful_scybear-1.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_colorful_scybear-1.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0

File hashes

Hashes for django_colorful_scybear-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e70cf21805da69159bf9200e35fd7d70bb0f9166f508360887813289d36cdba1
MD5 51f8ca1f6c9301af84e6ff3fd1682c40
BLAKE2b-256 0d7d5b406befe5d0171341cc07013e4bddc54eee1e62669e271e1f6f94039211

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page