der-gabe / django-colorinput

Model and form fields to store RGB colors as hex strings and widget to render the native HTML5 color input element
GNU General Public License v3.0
0 stars 0 forks source link

Model stores value as six characters when three bytes would do #9

Open der-gabe opened 4 years ago

der-gabe commented 4 years ago

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.