HOW we can convert the Colour name into Haxadecimal Value? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

HOW we can convert the Colour name into Haxadecimal Value?

For example black colour hava #000000 decimal value...

11th Oct 2020, 8:13 AM
Zeroboy
Zeroboy - avatar
5 Answers
+ 6
Go to this website and you will understand everything https://htmlcolorcodes.com/
11th Oct 2020, 8:16 AM
</𝚜𝚌𝚘𝚛𝚙𝚒𝚘𝚗>
</𝚜𝚌𝚘𝚛𝚙𝚒𝚘𝚗> - avatar
+ 5
Use a dictionary (sometimes called an object). Or, you could use JS to display that colour on a hidden canvas, then get the image data and convert to hexadecimal. If you want to learn more about the latter, ask and I can assist. Happy coding!
11th Oct 2020, 8:18 AM
Rowsej
Rowsej - avatar
11th Oct 2020, 8:17 AM
Zeroboy
Zeroboy - avatar
+ 1
Zeroboy you are welcome 😊
11th Oct 2020, 8:17 AM
</𝚜𝚌𝚘𝚛𝚙𝚒𝚘𝚗>
</𝚜𝚌𝚘𝚛𝚙𝚒𝚘𝚗> - avatar
11th Oct 2020, 8:18 AM
Zeroboy
Zeroboy - avatar