Skip to content

Commit 42d6eb0

Browse files
committed
Deprecated and remove the Color class
1 parent 93a0808 commit 42d6eb0

File tree

4 files changed

+52
-1131
lines changed

4 files changed

+52
-1131
lines changed

docs/deprecated.rst

+37-1
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,42 @@ as::
600600
camera = picamera.PiCamera(resolution='720p')
601601

602602

603+
Color module
604+
------------
605+
606+
The :mod:`picamera.color` module has now been split off into the `colorzero`_
607+
library and as such is deprecated in its entirety. The `colorzero`_ library
608+
contains everything that the color module used, along with a few enhancements
609+
and several bug fixes and as such the transition is expected to be trivial.
610+
Look for any imports of the :class:`~picamera.color.Color` class::
611+
612+
from picamera import Color
613+
614+
c = Color('green')
615+
616+
Replace these with references to :class:`colorzero.Color` instead::
617+
618+
from colorzero import Color
619+
620+
c = Color('green')
621+
622+
Alternatively, if the :class:`~picamera.color.Color` class is being used
623+
directly from picamera itself::
624+
625+
import picamera
626+
627+
camera = picamera.PiCamera()
628+
c = picamera.Color('red')
629+
630+
In this case add an import for colorzero, and reference the class from there::
631+
632+
import picamera
633+
import colorzero
634+
635+
camera = picamera.PiCamera()
636+
c = colorzero.Color('red')
637+
638+
603639
.. _semantic versioning: http://semver.org/
604640
.. _PEP-8: http://legacy.python.org/dev/peps/pep-0008/
605-
641+
.. _colorzero: https://colorzero.readthedocs.io/

picamera/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,3 @@
112112
)
113113
from picamera.streams import PiCameraCircularIO, CircularIO, BufferIO
114114
from picamera.color import Color, Red, Green, Blue, Hue, Lightness, Saturation
115-

0 commit comments

Comments
 (0)