11 ms·
This is an example of "naming this is hard". You call a function passing a string of "blue", but the fuction's variable is named hex implying it will hold some
by dylan604 5y ago
This is an example of "naming this is hard".
You call a function passing a string of "blue", but the fuction's variable is named hex implying it will hold something formated "0000FF". yes, it's still a string, but....
I don't mean to be overly critical of pseudo code examples. I just wanted to point out how naming things is hard even in quicky code.
We now return to your regularly scheduled discussion already in progress.
- squeaky-clean 5y agoThe html color attribute can be given either a hexadecimal string or a named html color keyword. I'm on my phone so I can't run their code, but it looks like it should work with both "blue" or "0000FF" (it might need to be "#0000FF"?). So that actually makes naming it even more difficult, in my opinion :P
- notRobot 5y agoIt will take either an HTML colour name, or a hex value. I agree that it could be named better.