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。