@@ -66,16 +66,11 @@ defined, and used throughout this module:
66
66
.. autodata :: IntTuple
67
67
.. autodata :: PercentTuple
68
68
69
- Constants
70
- ---------
71
-
72
- Several sets of constants are provided in ``webcolors ``, for use when
73
- converting or identifying colors or specifications.
74
69
75
70
.. _spec-constants :
76
71
77
- Specification identifiers
78
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
72
+ Constants
73
+ ---------
79
74
80
75
The following constants are available for indicating the specification from
81
76
which to draw color name choices, in functions which can work with multiple
@@ -98,81 +93,6 @@ specifications.
98
93
Represents the HTML 4 specification. Value is ``"html4" ``.
99
94
100
95
101
- .. _mapping-constants :
102
-
103
- Color mappings
104
- ~~~~~~~~~~~~~~
105
-
106
- The following constants are available for direct use in mapping from color
107
- names to values, although it is strongly recommended to use one of the
108
- normalizing conversion functions instead.
109
-
110
-
111
- Mappings from names to hexadecimal values
112
- +++++++++++++++++++++++++++++++++++++++++
113
-
114
- .. data :: HTML4_NAMES_TO_HEX
115
-
116
- A :class: `dict ` whose keys are the normalized names of the sixteen named
117
- HTML 4 colors, and whose values are the normalized hexadecimal values of
118
- those colors.
119
-
120
- .. data :: CSS2_NAMES_TO_HEX
121
-
122
- An alias for :data: `~webcolors.HTML4_NAMES_TO_HEX `, as CSS2 defined the same
123
- set of colors.
124
-
125
- .. data :: CSS21_NAMES_TO_HEX
126
-
127
- A :class: `dict ` whose keys are the normalized names of the seventeen named
128
- CSS2.1 colors, and whose values are the normalized hexadecimal values of
129
- those colors (sixteen of these are identical to HTML 4 and CSS2; the
130
- seventeenth color is ``"orange" ``, added in CSS2.1).
131
-
132
- .. data :: CSS3_NAMES_TO_HEX
133
-
134
- A :class: `dict ` whose keys are the normalized names of the 147 named CSS3
135
- colors, and whose values are the normalized hexadecimal values of those
136
- colors. These colors are also identical to the 147 named colors of SVG.
137
-
138
-
139
- Mappings from hexadecimal values to names
140
- +++++++++++++++++++++++++++++++++++++++++
141
-
142
- .. data :: HTML4_HEX_TO_NAMES
143
-
144
- A :class: `dict ` whose keys are the normalized hexadecimal values of the
145
- sixteen named HTML 4 colors, and whose values are the corresponding
146
- normalized names.
147
-
148
- .. data :: CSS2_HEX_TO_NAMES
149
-
150
- An alias for :data: `~webcolors.HTML4_HEX_TO_NAMES `, as CSS2 defined the same
151
- set of colors.
152
-
153
- .. data :: CSS21_HEX_TO_NAMES
154
-
155
- A :class: `dict ` whose keys are the normalized hexadecimal values of the
156
- seventeen named CSS2.1 colors, and whose values are the corresponding
157
- normalized names (sixteen of these are identical to HTML 4 and CSS2; the
158
- seventeenth color is ``"orange" ``, added in CSS2.1).
159
-
160
- .. data :: CSS3_HEX_TO_NAMES
161
-
162
- A :class: `dict ` whose keys are the normalized hexadecimal values of the 147
163
- named CSS3 colors, and whose values are the corresponding normalized
164
- names. These colors are also identical to the 147 named colors of SVG.
165
-
166
- .. note :: **Spelling variants**
167
-
168
- Some values representing named gray colors can map to either of two names
169
- in CSS3, because it supports both ``"gray" `` and ``"grey" `` spelling
170
- variants for those colors. This mapping will always return the variant
171
- spelled ``"gray" `` (such as ``"lightgray" `` instead of
172
- ``"lightgrey" ``). See :ref: `the documentation on name conventions
173
- <color-name-conventions>` for details.
174
-
175
-
176
96
Normalization functions
177
97
-----------------------
178
98
0 commit comments