ok
Direktori : /proc/self/root/lib64/python2.7/ |
Current File : //proc/self/root/lib64/python2.7/colorsys.pyo |
� \цdc @ s d Z d d d d d d g Z d d Z d d Z d d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d S( sJ 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 t rgb_to_yiqt yiq_to_rgbt rgb_to_hlst hls_to_rgbt rgb_to_hsvt hsv_to_rgbg �?g @g @g @c C s[ d | d | d | } d | d | d | } d | d | d | } | | | f S( Ng333333�?g�z�G��?g)\��(�?g333333�?g�Q����?g{�G�z�?g�z�G��?g�p= ף�?gףp= ��?( ( t rt gt bt yt it q( ( s /usr/lib64/python2.7/colorsys.pyR % s c C s� | d | d | } | d | d | } | d | d | } | d k rW d } n | d k rl d } n | d k r� d } n | d k r� d } n | d k r� d } n | d k r� d } n | | | f S( NgD��)X�?gS�h��?g�fb���?g��4�Ry�?g���V��?gv�ꭁ��?g g �?( ( R R R R R R ( ( s /usr/lib64/python2.7/colorsys.pyR + s c C s t | | | � } t | | | � } | | d } | | k rK d | d f S| d k rl | | | | } n | | d | | } | | | | } | | | | } | | | | } | | k r� | | } n+ | | k r� d | | } n d | | } | d d } | | | f S( Ng @g g �?g @g @g �?( t maxt min( R R R t maxct minct lt st rct gct bct h( ( s /usr/lib64/python2.7/colorsys.pyR C s$ c C s� | d k r | | | f S| d k r6 | d | } n | | | | } d | | } t | | | t � t | | | � t | | | t � f S( Ng g �?g �?g @( t _vt ONE_THIRD( R R R t m2t m1( ( s /usr/lib64/python2.7/colorsys.pyR Z s c C sb | d } | t k r* | | | | d S| d k r: | S| t k r^ | | | t | d S| S( Ng �?g @g �?( t ONE_SIXTHt TWO_THIRD( R R t hue( ( s /usr/lib64/python2.7/colorsys.pyR d s c C s� t | | | � } t | | | � } | } | | k rC d d | f S| | | } | | | | } | | | | } | | | | } | | k r� | | } n+ | | k r� d | | } n d | | } | d d } | | | f S( Ng g @g @g @g �?( R R ( R R R R R t vR R R R R ( ( s /usr/lib64/python2.7/colorsys.pyR t s c C s | d k r | | | f St | d � } | d | } | d | } | d | | } | d | d | } | d } | d k r� | | | f S| d k r� | | | f S| d k r� | | | f S| d k r� | | | f S| d k r� | | | f S| d k r | | | f Sd S( Ng g @g �?i i i i i i i ( t int( R R R R t ft pR t t( ( s /usr/lib64/python2.7/colorsys.pyR � s( N( t __doc__t __all__R R R R R R R R R R ( ( ( s /usr/lib64/python2.7/colorsys.pyt <module> s