简体   繁体   中英

How to get the name of color from hexadecimal code in java?

I use openCV for color identification and I get the color in hexadecimal form, like '#FF0000'.
Now I want to convert that to a string.

I have searched a lot, but I didn't find any useful code.
Please help and tell me, if anyone knows the answer.

There is no exact color name of each hexadecimal color code. So what you need is an approximation .

Searching for "approximate color name", I found some usefull links :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM