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.

GitHub Actions 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.

Project details


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-1.4.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_colorful-1.4.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file django_colorful-1.4.0.tar.gz.

File metadata

  • Download URL: django_colorful-1.4.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for django_colorful-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f668374b20f6d8135a2de4534ca0d6d8bdb3d46235db8664a8d8532e5af0f66e
MD5 f329f473c1c0860dfb359b4df2066d6d
BLAKE2b-256 5b592c441ba96424aed004dc68e2ee1f2b0ed45f5074a9ed4c26d8f797567ba3

See more details on using hashes here.

File details

Details for the file django_colorful-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_colorful-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9f5371cd62ae0e06ae2e0a12ac87dbd2d8bddf84c6cc325423bb3f71662a6d
MD5 7922e877afa60b0b1a8dc281eae8e119
BLAKE2b-256 422b10e586b93b52f7b976e01ca9e2f848130ee24e3af7462a1e571fb4c54ad0

See more details on using hashes here.

Supported by

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