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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-colorful-scybear-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec119b810bd6d6ca991353c6fad878b49ac87cd4b6399eb2d05ba0f25ddfda9 |
|
MD5 | 42a4d9cddd1df7facba6c2518b4c48da |
|
BLAKE2b-256 | a6ec0b08fcb30f48889c9cb45edbf9d467e257cb43f182ba27e766ac07f25a8b |
Close
Hashes for django_colorful_scybear-1.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e70cf21805da69159bf9200e35fd7d70bb0f9166f508360887813289d36cdba1 |
|
MD5 | 51f8ca1f6c9301af84e6ff3fd1682c40 |
|
BLAKE2b-256 | 0d7d5b406befe5d0171341cc07013e4bddc54eee1e62669e271e1f6f94039211 |