![]() Since approximation exists in the conversion algorithms, degradation will occur: > yiq_to_web(rgb_to_yiq(hex_to_rgb('808080'))) Using these static conversion methods, one can chain conversions (due to the in-param and out-param of all multi-value color representations being a tuple), which you are unable to do using the Python default colorsys.: > rgb_to_hex(hex_to_rgb('#808080')) These same conversions can be done without instantiating a Color object by using the static methods: The web representation will return the hex value if the color is not a well-known named web color: > c = Color((1, 243, 77)) If the color were such that the HEX representation could be captured as a 3-char hex: > c = Color((0, 0, 0)) ![]() Each instantiated Color object has properties which will automatically perform the required conversions: > c = Color((46, 139, 87)) ![]() The current color models supported by colorutils are: RGB, HEX, WEB, YIQ, and HSV. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |