Skip to main content

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:

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

Now you can use ColorField in your models:

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:

<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).

Release files for django-colorinput 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-colorinput 0.2
File Size Uploaded
django-colorinput-0.2.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-colorinput 0.2
File Interpreter ABI Platform
django_colorinput-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / django-colorinput-0.2.tar.gz

Download URL django-colorinput-0.2.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
aa558987a1aecb230a448b19955a5d7856edcc03c9b3b25253b9a204e9bef377
BLAKE2b-256 checksum
How to use checksums
ef1811559ed18f4c644da61e66e73dd083e302ebcdd6341788391717479b9769
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

Release files / django_colorinput-0.2-py3-none-any.whl

Download URL django_colorinput-0.2-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b1dacedda44f556365cfcdd618d80049498cfdcf41d37bd15543ba1d1b973e
BLAKE2b-256 checksum
How to use checksums
be617e4558e4772fbe10a79283e2f089f457e9dc41cf5d1471ddf0ea167fcd10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page