1"""
2Functions for working with the color names and color value formats defined by the
3HTML and CSS specifications for use in documents on the web.
4
5See documentation (in docs/ directory of source distribution) for details of the
6supported formats, conventions and conversions.
7
8"""
9
10# SPDX-License-Identifier: BSD-3-Clause
11
12from ._conversion import (
13 hex_to_name,
14 hex_to_rgb,
15 hex_to_rgb_percent,
16 name_to_hex,
17 name_to_rgb,
18 name_to_rgb_percent,
19 rgb_percent_to_hex,
20 rgb_percent_to_name,
21 rgb_percent_to_rgb,
22 rgb_to_hex,
23 rgb_to_name,
24 rgb_to_rgb_percent,
25)
26from ._definitions import CSS2, CSS3, CSS21, HTML4, names
27from ._html5 import (
28 html5_parse_legacy_color,
29 html5_parse_simple_color,
30 html5_serialize_simple_color,
31)
32from ._normalization import (
33 normalize_hex,
34 normalize_integer_triplet,
35 normalize_percent_triplet,
36)
37from ._types import HTML5SimpleColor, IntegerRGB, IntTuple, PercentRGB, PercentTuple
38
39__all__ = [
40 "HTML4",
41 "CSS2",
42 "CSS21",
43 "CSS3",
44 "name_to_hex",
45 "name_to_rgb",
46 "name_to_rgb_percent",
47 "hex_to_name",
48 "hex_to_rgb",
49 "hex_to_rgb_percent",
50 "names",
51 "rgb_to_hex",
52 "rgb_to_name",
53 "rgb_to_rgb_percent",
54 "rgb_percent_to_hex",
55 "rgb_percent_to_name",
56 "rgb_percent_to_rgb",
57 "html5_parse_simple_color",
58 "html5_parse_legacy_color",
59 "html5_serialize_simple_color",
60 "normalize_hex",
61 "normalize_integer_triplet",
62 "normalize_percent_triplet",
63 "IntegerRGB",
64 "PercentRGB",
65 "HTML5SimpleColor",
66 "IntTuple",
67 "PercentTuple",
68]