python colornames
v1.1.0
一个用于查找颜色名称的Python库。
colornames
库为您提供任何RGB颜色的名称。如果您要寻找的确切颜色没有名称,它将找到最接近的匹配项。
PYPI:Pycolornames
pip install pycolornames
库揭示了一个单个功能, find
。它找到给定颜色的名称。
>> > import colornames
>> > colornames . find ( 255 , 255 , 255 ) # Decimal RGB
'White'
>> > colornames . find ( '#3e3e3e' ) # Hexadecimal notation
'Dune'
>> > colornames . find ( '#abc' ) # Shorthand hexadecimal
'Cadet Blue'
>> > colornames . find ( 'f5f5f5' ) # Optional '#' prefix
'Wild Sand'
>> > colornames . find (( 123 , 12 , 1 )) # Decimal RGB as a tuple
'Dark Burgundy'
该代码是根据MIT许可证获得许可的。某些零件是根据2.5的CC许可(请参阅确认)。
颜色名称列表基于Chirag Mehta的NTC JS,根据CC的许可为2.5。