ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python2.7/site-packages/pynche/ColorDB.pyc
ó
¿œ^c	@sdZddlZddlZddlTddlZdefd„ƒYZdadZ	dZ
dd3d	„ƒYZd
efd„ƒYZdefd
„ƒYZ
de
fd„ƒYZdefd„ƒYZejdƒefejdƒefejdƒe
fejdƒefejdƒefgZdd„ZiZd„Ziad„Zd5Zd„Zd„ZedkredƒZesœd GHejd!ƒnd"Zejeƒ\ZZ Z!Z"eGd#GeGe Ge!Gee"ƒGHej#e"ƒ\Z$Z%d$Ge$Gd%Ge
j&e%ƒGHd6\Z'Z(Z)d7\Z'Z(Z)d8\Z'Z(Z)d-GeGd.GHddl*Z*e*j*ƒZ+ej,e'e(e)ƒZ,e*j*ƒZ-d/Ge,Gd0Ge-e+Gd1GHxiej.ƒD]XZ/eje/ƒ\Z'Z(Z)ej0e'e(e)ƒZ%d2e/e'e(e)e	j&e%d!ƒfGHq¥WndS(9sGColor Database.

This file contains one class, called ColorDB, and several utility functions.
The class must be instantiated by the get_colordb() function in this file,
passing it a filename to read a database out of.

The get_colordb() function will try to examine the file to figure out what the
format of the file is.  If it can't figure out the file format, or it has
trouble reading the file, None is returned.  You can pass get_colordb() an
optional filetype argument.

Supporte file types are:

    X_RGB_TXT -- X Consortium rgb.txt format files.  Three columns of numbers
                 from 0 .. 255 separated by whitespace.  Arbitrary trailing
                 columns used as the color name.

The utility functions are useful for converting between the various expected
color formats, and for calculating other color values.

iÿÿÿÿN(t*tBadColorcBseZRS((t__name__t
__module__(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRst s, tColorDBcBsYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	c
CsAd}|j|_i|_i|_d|_x
|D]}|jj|ƒ}|s„tj	dI|jIdI|IJ|d7}q4n|j
|ƒ\}}}|j|ƒ}|jƒ}	|||f}
|jj
|
|gfƒ\}}||kr||kr|j|ƒn||f|j|
<|
|j|	<|d}q4WdS(NisError ins linei(tnamet_ColorDB__namet_ColorDB__byrgbt_ColorDB__bynametNonet_ColorDB__allnamest_retmatchtsyststderrt_extractrgbt_extractnametlowertgettappend(
tselftfptlinenotlinetmotredtgreentblueRtkeynametkeyt	foundnametaliases((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyt__init__'s*			
"
!
cCs,g|jdddƒD]}t|ƒ^qS(NRRR(tgrouptint(RRtx((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRMscCs
|jdƒS(NR(R"(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRPscCs|jS(N(R(R((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pytfilenameSscCs3y|j|SWntk
r.t|ƒ‚nXdS(sReturn name for rgbtupleN(RtKeyErrorR(Rtrgbtuple((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyt
find_byrgbVs
cCs?|jƒ}y|j|SWntk
r:t|ƒ‚nXdS(s"Return (red, green, blue) for nameN(RR	R&R(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pytfind_byname]s

cCs«d}d}x˜|jjƒD]‡\}}|j|jƒ\}}	}
||}||	}||
}
|||||
|
}|dks”||kr|}|}qqW|S(s3Return the name of color nearest (red, green, blue)iÿÿÿÿt(RtvaluesR	R(RRRRtnearesttnearest_nameRR trtgtbtrdeltatgdeltatbdeltatdistance((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR,es



cCse|js^g|_x-|jjƒD]\}}|jj|ƒq"Wd„}|jj|ƒn|jS(NcSst|jƒ|jƒƒS(N(tcmpR(tn1tn2((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyt
nocase_cmp~s(RRR+Rtsort(RRR R8((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pytunique_namesws			cCsTy |j|||f\}}Wn&tk
rHt|||fƒ‚nX|g|S(N(RR&R(RRRRRR ((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyt
aliases_ofƒs
 
(RRR!RRR%R(R)R,R:R;(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR&s	&							t
RGBColorDBcBseZejdƒZRS(s?\s*(?P<red>\d+)\s+(?P<green>\d+)\s+(?P<blue>\d+)\s+(?P<name>.*)(RRtretcompileR(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR<‹stHTML40DBcBs eZejdƒZd„ZRS(s+(?P<name>\S+)\s+(?P<hexrgb>#[0-9a-fA-F]{6})cCst|jdƒƒS(Nthexrgb(trrggbb_to_tripletR"(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR“s(RRR=R>RR(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR?stLightlinkDBcBs eZejdƒZd„ZRS(s,(?P<name>(.+))\s+(?P<hexrgb>#[0-9a-fA-F]{6})cCs|jdƒjƒS(NR(R"tstrip(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR™s(RRR=R>RR(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRB–st	WebsafeDBcBs)eZejdƒZd„Zd„ZRS(s(?P<hexrgb>#[0-9a-fA-F]{6})cCst|jdƒƒS(NR@(RAR"(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRŸscCs|jdƒjƒS(NR@(R"tupper(RR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyR¢s(RRR=R>RRR(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRDœs	tXorgtXConsortiumtHTMLt	lightlinktWebsafec	Cs¢d}t|ƒ}zx|jƒ}|s+dS|dkr@t}n	|g}x1|D]%\}}|j|ƒ}|rPPqPqPWdS||ƒ}Wd|jƒX|a|S(N(R
topentreadlinet	FILETYPEStsearchtcloset
DEFAULT_DB(	tfiletfiletypetcolordbRRt	filetypesttyperetclass_R((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pytget_colordb³s$		cCsœtj|ƒ}|dkr˜|ddkr:t|ƒ‚n|dd!}|dd!}|dd!}t|dƒt|dƒt|dƒf}|t|<n|S(	s9Converts a #rrggbb color to the tuple (red, green, blue).it#iiiiiN(t	_namedictRR
RR#(tcolorR'RRR((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyRAÓs


*
cCs6tj|ƒ}|dkr2d|}|t|<n|S(s/Converts a (red, green, blue) tuple to #rrggbb.s
#%02x%02x%02xN(t	_tripdictRR
(R'thexname((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyttriplet_to_rrggbbâs


gp@icCsttj|tƒS(N(tmaptoperatort__div__t	_maxtuple(R'((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyttriplet_to_fractional_rgbíscCs6d}d}d}||d||d||dS(Ng‰A`åÐ"Ó?gbX9´Èâ?gÉv¾Ÿ/½?iii((R'R.R/R0((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyttriplet_to_brightnessñst__main__s/usr/openwin/lib/rgb.txts!No parseable color database founditnavyt:sname:saliases:i€i‘iîiiÿiûiúsfinding nearest tos...sfound nearest colortintsecondss%20s: (%3d/%3d/%3d) == %s((gp@(gp@gp@gp@(iii€(i‘iîi(iÿiûiú(1t__doc__RR=ttypesR_t	ExceptionRR
RPtSPACEt
COMMASPACERR<R?RBRDR>RMRWRYRAR[R]RaRbRcRRStexitttargetR)RRRR'R(RR tjoinR.R/R0ttimett0R,tt1R:tnR;(((s4/usr/lib64/python2.7/site-packages/pynche/ColorDB.pyt<module>sd
e