2biD
S SK Jr S SKJr S SKJrJrJr SSKJ r \( a S SK
Jr " S S5 r\
S :X aL S S
KrS SKJr S SKJr S S
KJrJr S SKJr S SKJr " S S5 r\" 5 r\R7 \" 5 5 g
g
) )sqrt) lru_cache)SequenceTuple
TYPE_CHECKING )ColorTripletTablec \ rS rSrSrS\\\\\4 4S jrS\S\ 4S jr
SS jr\" S S
9S\\\\4 S\4S j5 r
S
rg)Palette zA palette of available colors.colorsc Xl g N_colors)selfr s ڊ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/rich/palette.py__init__Palette.__init__ s numberreturnc , [ U R U 6 $ r )r r )r r s r __getitem__Palette.__getitem__ s T\\&122r c
, SSK Jn SSKJn SSKJn SSKJn U" SSSS [ U R 5 S
3SSS
9n[ U R 5 H@ u pgUR [ U5 [ U5 U" SU" UR " U6 S9S95 MB U$ )Nr ColorStyle)Textr
indexRGBr r
z colorsTright)titlecaption highlightcaption_justifyz )bgcolor)style)pip._vendor.rich.colorr pip._vendor.rich.styler" pip._vendor.rich.textr# pip._vendor.rich.tabler lenr enumerateadd_rowstrreprfrom_rgb)r r r" r# r tabler$ colors r __rich__Palette.__rich__ s 00.04<<()1#
&dll3LEMME
UXU5>>53I%JK
4 r i )maxsizer8 c ^^^^^ Uu mmm[ mU R R mS[ S[ 4UUUUU4S jjn[ [
[ U R 5 5 US9nU$ )zFind a color from a palette that most closely matches a given color.
Args:
color (Tuple[int, int, int]): RGB components in range 0 > 255.
Returns:
int: Index of closes matching color.
r$ r c > T
" U 5 u pnTU- S- nTU-
nTU-
nT U-
nT" SU- U- U- S- SU- U- - SU-
U- U- S- - 5 $ )zGet the distance to a color. i i )
r$ red2green2blue2red_meanredgreenblue_sqrtblue1 get_colorgreen1red1s
r get_color_distance)Palette.match.