Skip to content

Commit 06b7e47

Browse files
committed
new: engine rewrite to provide easier writing of new formats.
These are the biggest API changes: - attribute ``hex_l`` removed in favor of ``hex`` which is now long (6 hexadigit long). Use ``hexs`` for the possibly shortened version to 3 hexadigit when possible. - ``LONG_HEX_COLOR`` and ``SHORT_HEX_COLOR`` are not available in module's scope anymore, but are moved in each corresponding format's attribute (``Hex.regex``, and ``HexS.regex``). - ``RGB``, ``HEX``, ``HSL`` helper classes output now again basic python types output (tuples and strings). And thus are unaware of any formats. - in a similar way, ``xxx2yyy`` conversion functions are unaware of any format and work with basic python types and returns basic python types.
1 parent 646b96d commit 06b7e47

2 files changed

Lines changed: 694 additions & 372 deletions

File tree

README.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ Reading values
131131
Several representations are accessible::
132132

133133
>>> c.hex
134+
'#0000ff'
135+
>>> c.hexs
134136
'#00f'
137+
>>> c.web
138+
'blue'
135139
>>> c.hsl # doctest: +ELLIPSIS
136140
Hsl(hue=0.66..., saturation=1.0, luminance=0.5)
137141
>>> c.rgb
@@ -158,12 +162,12 @@ Or the hue, saturation and luminance of the HSL representation::
158162
>>> c.luminance
159163
0.5
160164

161-
A note on the ``.hex`` property, it'll return the smallest valid value
162-
when possible. If you are only interested by the long value, use
163-
``.hex_l``::
165+
A note on the ``.hex`` property: it'll return the 6 hexadigit, if you
166+
needed the version of this format that allow short 3 hexadigit when possible,
167+
use ``hexs`` format::
164168

165-
>>> c.hex_l
166-
'#0000ff'
169+
>>> c.hexs
170+
'#00f'
167171

168172

169173
Modifying color objects

0 commit comments

Comments
 (0)