-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathREADME
55 lines (34 loc) · 1.36 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Django Colors
=============
Author: Maxime Haineault ([email protected])
http://motion-m.ca/projets/django-colors/
http://code.google.com/p/django-colors/
Introduction
============
Django colors is a small django app that we created to make our life easier while designing websites with the Django framework.
The app consist of a set of template filters which can manipulate hexadecimal colors. For example, you can easily increase or decrease the lightness or the saturation of a color:
Template usage example
----------------------
{% load colors %}
<b style="background:#00ffff;">Lorem</b>
<b style="background:#{{ "00ffff"|lightness:"40" }};">Ipsum</b>
<b style="background:{{ "0ff"|opposite|hex_to_rgb:"rgb(%d,%d,%d)" }};">
Dolor</b>
{# Rendered #}
<b style="background:#00ffff;">Lorem</b>
<b style="background:#006666;">Ipsum</b>
<b style="background:rgb(255, 0, 0);">Dolor</b>
Installation
============
There is two ways to install this library. You can install it system wide or use it within your project.
System wide installation
------------------------
sudo python setup.py install
Local installation
------------------
Simply add the "colors" folder in your PYTHONPATH or copy it in your project folder.
Django setup
============
1 Add 'colors' to your INSTALLED_APPS in settings.py
2. In your template load it using {% load colors %}
3. That's it !