tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
L\¬Qc@sdZddddddgZddZdd    Zd
dZd „Zd „Zd „Zd„Zd„Z    d„Z
d„Z dS(sJConversion 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@cCs[d|d|d|}d|d|d|}d|d|d    |}|||fS(
Ng333333Ó?gáz®Gáâ?g)\Âõ(¼?g333333ã?gìQ¸…ëÑ?g{®GázÔ?gáz®GáÊ?g¤p=
×£à?g×£p=
×Ó?((trtgtbtytitq((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyR%scCsÍ|d|d|}|d|d|}|d|d|}|dkrWd}n|dkrld}n|dkrd}n|dkr–d}n|dkr«d}n|dkrÀd}n|||fS(    NgDÁŒ)Xî?gSìhê÷ã?gýfbº«Ñ?gšë4ÒRyä?g«ÏÕVì¯ñ?gv‰ê­­û?ggð?((R    R
R RRR((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyR+s                               c Cst|||ƒ}t|||ƒ}||d}||krKd|dfS|dkrl||||}n||d||}||||}||||}||||}    ||krÑ|    |}
n+||krîd||    }
nd||}
|
dd}
|
||fS(Ng@ggà?g@g@gð?(tmaxtmin( RRRtmaxctminctltstrctgctbcth((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyRCs$      cCs|dkr|||fS|dkr6|d|}n||||}d||}t|||tƒt|||ƒt|||tƒfS(Nggà?gð?g@(t_vt    ONE_THIRD(RRRtm2tm1((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyRZs   cCsb|d}|tkr*||||dS|dkr:|S|tkr^|||t|dS|S(Ngð?g@gà?(t    ONE_SIXTHt    TWO_THIRD(RRthue((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyRds
   c Csæt|||ƒ}t|||ƒ}|}||krCdd|fS|||}||||}||||}||||}    ||kr |    |}
n+||kr½d||    }
nd||}
|
dd}
|
||fS(Ngg@g@g@gð?(R R ( RRRRRtvRRRRR((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyRts      cCs|dkr|||fSt|dƒ}|d|}|d|}|d||}|d|d|}|d}|dkr|||fS|dkr©|||fS|dkrÂ|||fS|dkrÛ|||fS|d    krô|||fS|d
kr |||fSdS( Ngg@gð?iiiiiii(tint(RRRR
tftpR tt((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyR‡s(  
           N( t__doc__t__all__RRRRRRRRRR(((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/colorsys.pyt<module>s