Documentation of new shorthand hex color specification. · matplotlib/matplotlib@790756f · GitHub
Skip to content

Commit 790756f

Browse files
Patrick FeiringPatrick Feiring
authored andcommitted
Documentation of new shorthand hex color specification.
1 parent 72e4f86 commit 790756f

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions

lib/matplotlib/colors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
interval ``[0, 1]`` (e.g., ``(0.1, 0.2, 0.5)`` or ``(0.1, 0.2, 0.5, 0.3)``);
4141
* a hex RGB or RGBA string (e.g., ``'#0f0f0f'`` or ``'#0f0f0f80'``;
4242
case-insensitive);
43+
* a shorthand hex RGB or RGBA string, equivalent to the hex RGB or RGBA
44+
string obtained by duplicating each character, (e.g., ``'#abc'``, equivalent
45+
to ``'#aabbcc'``, or ``'#abcd'``, equivalent to ``'#aabbccdd'``;
46+
case-insensitive);
4347
* a string representation of a float value in ``[0, 1]`` inclusive for gray
4448
level (e.g., ``'0.5'``);
4549
* one of ``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``, they are the single

tutorials/colors/colors.py

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)