Live data from Hacker News

Show HN: Do you know RGB?

maxwellito.github.io

31–40 of 64 posts

Re: Show HN: Do you know RGB?

#32

> do you know rgb > colours are in hex am I missing something or being dumb?

This is hexadecimal notation for rgb. Each character represents 2 bytes, which encode a value from 0 to 255. This is a bit more confusing because this is a shorthand notation: you’d actually need 2 hexadecimal characters for 2 bytes (eg #0077ff would be rbg(0, 127, 255)). In this shorthand notation, I think there’s an implied 0 (eg #07f is #0070f0). So you can’t represent all rgb colour with only 3 characters, but fo…

Every tool I've ever used referred to this as hex (including design tools but maybe I'm sheltered), whereas rgb refers to the 0-255 triples

If someone asked me for a colour in "RGB" they'd be rightly confused if gave them a hex format colour (obviously you can convert between them but that's not what they asked for)

Re: Show HN: Do you know RGB?

#33
post #8

I’m so confused. This is something people know? I mean, I can work it out from first principles knowing how color mixing works, but it sounds like people just … know them? I’ve been programming for almost 40 years and it would never have occurred to me to memorize this sort of thing.

Just know them no. Able to sanity check that an RGB value is the color it's supposed to be yes sometimes. It's not the most useful skill because you almost always get a swatch now, but sometimes being able to have some idea of how it'll look (should it be dark or light, grey or intense color) saves me 10 seconds here and there.

I like playing guess-RGB games every now and then because it improves the skill, but at the same time I find them really stressful haha.

Re: Show HN: Do you know RGB?

#34

Definitely don't make the game end dafter one wrong guess. At least give me some lives or something, damn. Or, better yet, just let me play to the end, then give me my score.

that's not really what you want, what you want is for the starting of a new game to be automatic and not require extra clicks.

the way I'm suggesting (which is what the game is with extra clicks) is a game of "what's my longest streak of correct guesses" which actually makes your score look better than keeping your losses around.

Re: Show HN: Do you know RGB?

#35
Off topic, but this seems like a decent place to ask:

Has anyone else noticed the weird new grey color that automobiles have in the last year or so? Does anyone know how to describe that color? Can anyone explain how it is different from previous greys in RGB terms? Or even in paint color terms?

Re: Show HN: Do you know RGB?

#36
post #8

I’m so confused. This is something people know? I mean, I can work it out from first principles knowing how color mixing works, but it sounds like people just … know them? I’ve been programming for almost 40 years and it would never have occurred to me to memorize this sort of thing.

>I mean, I can work it out from first principles knowing how color mixing works

did you try it? if you can work it out from first principles because you know how color mixing works, you should get a perfect score; that's the game. If you don't get a perfect score, you need to reinspect what you think you know about color mixing and even the first principles.

Re: Show HN: Do you know RGB?

#38
post #36
post #8

I’m so confused. This is something people know? I mean, I can work it out from first principles knowing how color mixing works, but it sounds like people just … know them? I’ve been programming for almost 40 years and it would never have occurred to me to memorize this sort of thing.

> I mean, I can work it out from first principles knowing how color mixing works did you try it? if you can work it out from first principles because you know how color mixing works, you should get a perfect score; that's the game. If you don't get a perfect score, you need to reinspect what you think you know about color mixing and even the first principles.

Yes, I got a perfect score. It just took me several minutes, whereas coworkers of mine got 15+ in just a few seconds.

Re: Show HN: Do you know RGB?

#39

> do you know rgb > colours are in hex am I missing something or being dumb?

This is hexadecimal notation for rgb. Each character represents 2 bytes, which encode a value from 0 to 255. This is a bit more confusing because this is a shorthand notation: you’d actually need 2 hexadecimal characters for 2 bytes (eg #0077ff would be rbg(0, 127, 255)). In this shorthand notation, I think there’s an implied 0 (eg #07f is #0070f0). So you can’t represent all rgb colour with only 3 characters, but fo…

The 3-digit shorthand for hexadecimal RGB colours dates back to CSS1, if not earlier.

From https://www.w3.org/TR/CSS1/>:

> The format of an RGB value in hexadecimal notation is a '#' immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This makes sure that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.

I'm quite fond of the 3-digit hexadecmial RGB notation. It's a concise way to express the colours I use for web pages or Emacs font locking. In these cases, I rarely need the full 16-million-colour range offered by 6 digits. The 3 digits are usually more than enough, at least to me.

Re: Show HN: Do you know RGB?

#40

Earlier quoted context omitted.

This is hexadecimal notation for rgb. Each character represents 2 bytes, which encode a value from 0 to 255. This is a bit more confusing because this is a shorthand notation: you’d actually need 2 hexadecimal characters for 2 bytes (eg #0077ff would be rbg(0, 127, 255)). In this shorthand notation, I think there’s an implied 0 (eg #07f is #0070f0). So you can’t represent all rgb colour with only 3 characters, but fo…

Every tool I've ever used referred to this as hex (including design tools but maybe I'm sheltered), whereas rgb refers to the 0-255 triples If someone asked me for a colour in "RGB" they'd be rightly confused if gave them a hex format colour (obviously you can convert between them but that's not what they asked for)

[deleted]
Post reply on HN