der-gabe / django-colorinput Goto Github PK
View Code? Open in Web Editor NEWModel and form fields to store RGB colors as hex strings and widget to render the native HTML5 color input element
License: GNU General Public License v3.0
Model and form fields to store RGB colors as hex strings and widget to render the native HTML5 color input element
License: GNU General Public License v3.0
This can be done with the list attribute (although it seems that using list
with the color type input element is currently unsupported on Firefox).
The selection of colors should be configurable via settings.py
.
By their very nature, the RGB values used in HTML consist of 3 bytes (octets) and are only represented by 6 characters.
Storing the character representation , rather than the actual value, is (ever so) slightly wasteful and I believe the overhead introduced by the conversion is (even more) negligible.
Changing this will require a migration, however, so it might not be worth it.
It appears the package, as published on PyPI, is missing the template subdirectory, which is needed for correct rendering of the input element, of course.
In the admin of models that use the color field, it's shown like a char field i.e. with a text type input field.
Oddly enough, the hash mark ("#") is displayed in the field, even though it's never stored in the DB.
A clue, perhaps?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.