0

Yesterday, I wanted to make a hex color previewer because I google searched the hex values and didn't get a color, instead I got Japanese sites & obscure cooking products. So I made the previewer, in simple JS and HTML. This morning, I was experimenting with the hex values and found that random words are valid as a hex value. 'Firetruck' is a nice yellow. I asked one of my teachers about it and he wondered if JS was interpreting 'firetruck' as a hexadecimal value. I set up an alert, to display the input of the user, and the background color of the document. Javascript is not switching to hex, but the word 'firetruck' in hex is yellow.

What is going on???

Sir Eel
  • 7
  • 3
  • As 'hex' is for 'hexadecimal', ideally it should not have values *more than* **F**. And [this](https://www.w3schools.com/Colors/colors_hexadecimal.asp) does not show `firetruck` yellowish or so. Maybe you can share the code behind your picker. – vahdet Jun 27 '18 at 18:22
  • Related if not a dupe: [Why does HTML think “chucknorris” is a color?](https://stackoverflow.com/q/8318911) – Heretic Monkey Jun 27 '18 at 18:25
  • It is an exact duplicate, thank you. – Sir Eel Jun 27 '18 at 18:36

0 Answers0