Skip to content

Commit

Permalink
Merge pull request #2 from radarhere/alpha
Browse files Browse the repository at this point in the history
Changes
  • Loading branch information
macjohnny committed Feb 9, 2021
2 parents 3f073ff + e64d62e commit a28bd57
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions docs/reference/ImageColor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,10 @@ Color Names
The ImageColor module supports the following string formats:

* Hexadecimal color specifiers, given as ``#rgb``, ``#rgba``, ``#rrggbb`` or
``#rrggbbaa``, with the following placeholders:

- ``r`` red
- ``g`` green
- ``b`` blue
- ``a`` alpha / opacity (can be used in combination with ``mode="RGBA"`` in
:py:mod:`~PIL.ImageDraw`)

Examples:

- ``#ff0000`` specifies pure red.
- ``#ff0000aa`` specifies pure red with an opacity of 66.66% (aa = 170, opacity =
170/255).

``#rrggbbaa``, where ``r`` is red, ``g`` is green, ``b`` is blue and ``a`` is
alpha (also called 'opacity'). For example, ``#ff0000`` specifies pure red,
and ``#ff0000cc`` specifies red with 80% opacity (``cc`` is 204 in decimal
form, and 204 / 255 = 0.8).

* RGB functions, given as ``rgb(red, green, blue)`` where the color values are
integers in the range 0 to 255. Alternatively, the color values can be given
Expand Down

0 comments on commit a28bd57

Please sign in to comment.