관리-도구
편집 파일: colorsys.cpython-310.pyc
o 6��f� � @ sT d Z g d�ZdZdZdZdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� ZdS )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 C sR d| d| d| }d| | d|| }d| | d|| }|||fS )Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g= ףp=�?� )�r�g�b�y�i�qr r �//opt/alt/python310/lib64/python3.10/colorsys.pyr ( s r c C s� | d| d| }| d| d| }| d| d| }|dk r$d}|dk r*d}|dk r0d}|dkr6d}|dkr<d}|dkrBd}|||fS ) Ng2r��L�?g����,��?g:�����?g�nєW�?g6����?gJ"�X�?� � �?r )r r r r r r r r r r . s r c C s� t | ||�}t| ||�}|| }|| }|d }||kr!d|dfS |dkr*|| }n|d| }|| | } || | } || | }| |krK|| }n||krVd| | }nd| | }|d d }|||fS )N� @r � �?� @� @r ��max�min) r r r �maxc�mincZsumcZrangec�l�s�rc�gc�bc�hr r r r K s( r c C sn |dkr |||fS |dkr|d| }n|| || }d| | }t ||| t �t ||| �t ||| t �fS )Nr r r r )�_v� ONE_THIRD)r r r �m2�m1r r r r c s *r c C sT |d }|t k r| || | d S |dk r|S |tk r(| || t| d S | S )Nr r r )� ONE_SIXTH� TWO_THIRD)r# r"