5 ms·
These CSS colors consist of 3 bytes in hex, the first gives the red value, second green and the last is blue. So: #FF0000 = 0xFF, 0x00, 0x00, which is pure
by LeonM 9y ago
These CSS colors consist of 3 bytes in hex, the first gives the red value, second green and the last is blue.
So:
#FF0000 = 0xFF, 0x00, 0x00, which is pure red
#0000FF = 0x00, 0x00, 0xFF, which is pure blue
#FF00FF = 0xFF, 0x00, 0xFF, which is red and blue mixed, so it's purple (violet)
#FFFFFF = 0xFF, 0xFF, 0xFF, all colors combined is white
etc
#C0FFEE = 0xC0, 0xFF, 0xEE, so by 'parsing' it in your head yo can see is mostly green and blue, combined that's cyan.
- Theodores 9y agoYes but you grew up typing hex codes into a home computer connected to a tape drive. You know what 8192 looks like in binary but everything beyond 65535 you struggle with because you didn't have the registers for that on your 6502A. It probably irritates you to see images scaled to 1000 pixels rather than 1024. What about that jpeg cell that is not 8 pixels square? Think of the computational overhead and the need to go floating point just because someone does not think in bytes. It is too late to tell them now, these kids ain't spending winter typing in hex. Hex to them is like BCD is to you and who needs binary coded decimal these days when emoji's need to be mastered? I don't mean you personally, just them folk that know their hex from learning to code that way. I think hex is important but it seems most front end developers would prefer not to know.
- WrtCdEvrydy 9y ago> I think <INSERT_THING_HERE> is important but it seems most front end developers would prefer not to know. This is my experience. There are two types of people in this industry, people who want to make money quick and those who are technologists.
- ovao 9y agoWhat would you guess is the ratio of each?
- WrtCdEvrydy 9y agoIn my experience, I tend to think it's something like 30% technologists, 70% money makers. Unfortunately, barely anyone (including myself) wants to see themselves as the second group (for the record, I think I'm on the second group).
- devdad 9y agoI disagree. Not wanting to learn hex does not make you less of a techie. One can only focus on so much, and tech is huge.
- cyphar 9y agoIn Australia you learn about base-N numbers in primary school, I don't understand why you see that as a huge undertaking. Ultimately if you ever have to check the mode of a file on *nix, or interact with bitmasks in any way, you're going to run into numbers in different bases. Not to mention memory addresses when debugging. I mean, it's not _mandatory_ but it's something you'll run into eventually (though since I do quite low level systems programming, I expect that I see hex a lot more often than web developers -- though CSS colours are also in hex).
- wolco 9y agoI would be surprised if a frontend developer didn't understand hex coloring.
- madeofpalk 9y agoDoesn't this apply to all sorts of professions in every industry? It's not a particularly unique insight.
- infogulch 9y agoYou don't even have to decode the actual number, just comparatively figure out which one 'looks bigger'. In more steps than necessary to be abundantly explicit: Step 1: group into two characters each. Step 2: know that hex is an extension of decimal that adds the digits A-F after 9. So just like 0<1, 9<A and A<B etc. Step 3: find the biggest and smallest groups by comparing the first digits of each. If they match they're pretty close. Step 3a (optional): guestimate the intensity of each color by thinking of the first digit on the scale from 0 is least intense to F is most intense. (5: somewhat less than half, D: pretty close to max, 1: almost none etc) Step 4: use your knowledge of additive color mixing to guestimate the color. You don't need to be able to map each digit to its' decimal equivalent first to get a general guess. If you're missing Step 4, then you can still figure out mostly-primary colors like #D53A1F. Step 1 should be trivial. Step 3 can be guestimated.
- Nursie 9y agoI'm sorry, but if you don't know how to read simple hex numbers for colours, and you're unwilling to learn, you probably shouldn't be in this game. It's like when people complain that they failed to install desktop Linux in the last couple of years - sure in the 90s that was a very valid complaint, and early last decade it was tricksy too. But now? It says more about them.
- wruza 9y agoTBH, in 90s I just pushed disk[ette] into the drive and booted into installer. Today I have to go through all the DVD-ISO-to-USB3-EFI hassle before it even boots. And then it still has no idea of how to install into that single partition that I created. The fact that users cannot just install the OS and use it after 2+ decades says more about OS, not about users.
- Nursie 9y agoI mean people on here, who are supposed to be technically minded. I'm not really sure what hassle you're talking about, but I was very specific in talking about people who proudly claim to have failed, here. My mother? Like most people, she might have trouble, but she probably doesn't even know what an OS is. A hacker news poster in 2017 should know better.
- wruza 9y agoI think you're mistaking tech-minded with linux-experienced. I am definitely tech-minded (unix & c are main tags) and was linux-experienced. Solved any issue in minutes, hours or days. Now I can't make my soundcard work in Debian because: A). I don't know the stack anymore. Pulseaudio, alsa, setting managers, etc. B). I don't want to dive in there again to get more amazing brand new details about how sound meant to be played at modern days on my 11yo PC with AC97 chip. I was like that too. Losers can't install, tune, [read hex colors,] etc. Then you realize that your time is finite, that your overall awareness has FOV parameter, that issues never end, they evolve. If you focus too much, you're solving local problems that should not be there in the first place, and these are not yours. So, things are wrong, not your FOV. Fix things, not yourself. Know hex for hardware, not for colors. That's what your parent's rant is about.
- wruza 9y agoThough I can read and even compare hex numbers easily, I'm with you that it would be great to just represent colors in "rgba(75 100 93 80)", i.e. colorspace(percents) format anywhere and to not deal with cryptic strings. Moreover, RGB isn't great at all. We need "10% lighter than deep purple", not #ec12e4. All the mind-calc is done in these terms anyway.
- wruza 9y agoAlso that it is bright and somewhat unsaturated, because its lowest component is 3/4 of full intensity.