%PDF- %PDF-
Direktori : /usr/lib/python3.12/__pycache__/ |
Current File : //usr/lib/python3.12/__pycache__/colorsys.cpython-312.pyc |
� ���f� � �F � d Z g d�ZdZdZdZd� Zd� Zd� Zd� Zd � Z d � Z d� Zy) aJ Conversion functions between RGB and other color systems. This modules provides two functions for each color system ABC: rgb_to_abc(r, g, b) --> a, b, c abc_to_rgb(a, b, c) --> r, g, b All inputs and outputs are triples of floats in the range [0.0...1.0] (with the exception of I and Q, which covers a slightly larger range). Inputs outside the valid range may cause exceptions or invalid outputs. Supported color systems: RGB: Red, Green, Blue components YIQ: Luminance, Chrominance (used by composite video signals) HLS: Hue, Luminance, Saturation HSV: Hue, Saturation, Value )� rgb_to_yiq� yiq_to_rgb� rgb_to_hls� hls_to_rgb� rgb_to_hsv� hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?c �r � d| z d|z z d|z z }d| |z z d||z z z }d| |z z d||z z z }|||fS )Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g= ףp=�?� )�r�g�b�y�i�qs �/usr/lib/python3.12/colorsys.pyr r ( s\ � ��Q���a���$�q�&� �A��a��c� �T�1�Q�3�Z��A��a��c� �T�1�Q�3�Z��A� �q�!�9�� c � � | d|z z d|z z }| d|z z d|z z }| d|z z d|z z }|dk rd}|dk rd}|dk rd}|dkD rd}|dkD rd}|dkD rd}|||fS ) Ng2r��L�?g����,��?g:�����?g�nєW�?g6����?gJ"�X�?� � �?r )r r r r r r s r r r . s� � � ��q� � �#5�a�#7�7�A� ���!�!�$6�q�$8�8�A� ��q� � �#5�a�#7�7�A��3�w����3�w����3�w����3�w����3�w����3�w��� �q�!�9�r c � � t | ||� }t | ||� }||z }||z }|dz }||k( rd|dfS |dk r||z }n|d|z |z z }|| z |z } ||z |z } ||z |z }| |k( r|| z }n||k( r d| z |z }nd| z | z }|dz dz }|||fS )N� @r � �?� @� @r ��max�min) r r r �maxc�minc�sumc�rangec�l�s�rc�gc�bc�hs r r r K s� � ��q�!�Q�<�D��q�!�Q�<�D���I�D��4�i�F��S��A��t�|��A�s�{���C�x��T�M���c�$�h�t�m�$�� �q�&�F� �B� �q�&�F� �B� �q�&�F� �B��D�y��r�E�� �d����F�2�I����F�2�I�� �3��#� �A��a��7�Nr c � � |dk( r|||fS |dk r |d|z z }n||z ||z z }d|z |z }t ||| t z � t ||| � t ||| t z � fS )Nr r r r )�_v� ONE_THIRD)r&