@@ -9,17 +9,20 @@ Introduction
9
9
:alt: Discord
10
10
11
11
12
- .. image :: https://github.com/CedarGroveStudios/Cedargrove_CircuitPython_ColorFader /workflows/Build%20CI/badge.svg
13
- :target: https://github.com/CedarGroveStudios/Cedargrove_CircuitPython_ColorFader /actions
12
+ .. image :: https://github.com/CedarGroveStudios/CircuitPython_ColorFader /workflows/Build%20CI/badge.svg
13
+ :target: https://github.com/CedarGroveStudios/CircuitPython_ColorFader /actions
14
14
:alt: Build Status
15
15
16
16
17
17
.. image :: https://img.shields.io/badge/code%20style-black-000000.svg
18
18
:target: https://github.com/psf/black
19
19
:alt: Code Style: Black
20
20
21
- A CircuitPython helper for brightness and gamma adjustment of an integer RGB color value.
22
-
21
+ A CircuitPython helper for brightness and gamma adjustment of an integer RGB
22
+ color value. Gamma is optionally applied after the brightness calculation.
23
+ Transparency is preserved. Returns an adjusted integer color value.
24
+ To adjust a ``displayio `` palette or multiple color list, use the
25
+ ``cedargrove_palettefader.PaletteFader `` class.
23
26
24
27
Dependencies
25
28
=============
@@ -31,35 +34,7 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
31
34
This is easily achieved by downloading
32
35
`the Adafruit library and driver bundle <https://circuitpython.org/libraries >`_
33
36
or individual libraries can be installed using
34
- `circup <https://github.com/adafruit/circup >`_.Installing from PyPI
35
- =====================
36
- .. note :: This library is not available on PyPI yet. Install documentation is included
37
- as a standard element. Stay tuned for PyPI availability!
38
-
39
- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
40
-
41
- On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
42
- PyPI <https://pypi.org/project/Cedargrove-circuitpython-colorfader/> `_.
43
- To install for current user:
44
-
45
- .. code-block :: shell
46
-
47
- pip3 install Cedargrove-circuitpython-colorfader
48
-
49
- To install system-wide (this may be required in some cases):
50
-
51
- .. code-block :: shell
52
-
53
- sudo pip3 install Cedargrove-circuitpython-colorfader
54
-
55
- To install in a virtual environment in your current project:
56
-
57
- .. code-block :: shell
58
-
59
- mkdir project-name && cd project-name
60
- python3 -m venv .venv
61
- source .env/bin/activate
62
- pip3 install Cedargrove-circuitpython-colorfader
37
+ `circup <https://github.com/adafruit/circup >`_.
63
38
64
39
Installing to a Connected CircuitPython Device with Circup
65
40
==========================================================
@@ -76,7 +51,7 @@ following command to install:
76
51
77
52
.. code-block :: shell
78
53
79
- circup install colorfader
54
+ circup install cedargrove_colorfader
80
55
81
56
Or the following command to update an existing version:
82
57
@@ -87,12 +62,22 @@ Or the following command to update an existing version:
87
62
Usage Example
88
63
=============
89
64
90
- .. todo :: Add a quick, simple example. It and other examples should live in the
91
- examples folder and be included in docs/examples.rst.
65
+ Scale a 24-bit RGB source color value in proportion to the brightness setting
66
+ (0 to 1.0). The adjusted color's gamma value is typically from 0.0 to 2.0 with
67
+ a default of 1.0 for no gamma adjustment. Returns an adjusted 24-bit RGB color
68
+ value or None if the source color is None (transparent).
69
+
70
+ .. code-block :: python
71
+
72
+ >> > from cedargrove_colorfader import color_fader
73
+ >> > # Dim a pure red color to 50%; no gamma adjustment
74
+ >> > print (hex (color_fader(source_color = 0x FF0000 , brightness = 0.5 , gamma = 1.0 )
75
+ 0x 7f0000
76
+
92
77
93
78
Documentation
94
79
============ =
95
- API documentation for this library can be found on ` Read the Docs <https://circuitpython-colorfader.readthedocs.io/ >`_.
80
+ API documentation for this library can be found `here < https:// circuitpython- colorfader.readthedocs.io/ > ` _.
96
81
97
82
For information on building library documentation, please check out
98
83
`this guide < https:// learn.adafruit.com/ creating- and - sharing- a- circuitpython- library/ sharing- our- docs- on- readthedocs# sphinx-5-1>`_.
@@ -101,5 +86,5 @@ Contributing
101
86
============
102
87
103
88
Contributions are welcome! Please read our `Code of Conduct
104
- <https://github.com/CedarGroveStudios/Cedargrove_CircuitPython_ColorFader /blob/HEAD/CODE_OF_CONDUCT.md> `_
89
+ < https:// github.com/ CedarGroveStudios/ CircuitPython_ColorFader / blob/ HEAD / CODE_OF_CONDUCT .md> `_
105
90
before contributing to help this project stay welcoming.
0 commit comments