Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: When I count, I think of numbers as...

by jonadab (Parson)
on May 29, 2005 at 11:20 UTC ( #461489=note: print w/ replies, xml ) Need Help??


in reply to Re^2: When I count, I think of numbers as...
in thread When I count, I think of numbers as...

No, no, no. This being a tech-geek forum, you should all know the *real* color/number correspondance:

0black
1blue
2green
3cyan
4red
5magenta
6brown/orange (dark yellow)
7light grey
8dark grey
9bright blue
10bright green
11bright cyan
12bright red
13bright magenta
14bright yellow
15white

"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68


Comment on Re: When I count, I think of numbers as...
Re^2: When I count, I think of numbers as...
by ambrus (Abbot) on May 29, 2005 at 17:41 UTC

    That's only one of them, the default palette used by VGA cards. But there's another one, the one used by vt100 terminals and internally by linux. That one has the red and blue bits swapped, like 0=black, 1=red, 2=green, 3=yellow, 4=blue etc. I know this because this second scheme is used by the \e]P palette changer escape sequence. (This is btw another proof why this is not the real color/number correspondence: that's only the deafult palette, you can change it to whatever you like. I've rebound magenta to orange once to display Rubik's cube patterns nicely.) The translation table between the rgb and bgr scheme is color_table in /linux/drivers/char/console.c.

    Update: see also Re: What is the Perl Color?.

      This is btw another proof why this is not the real color/number correspondence: that's only the deafult palette, you can change it to whatever you like

      VGA cards use it as the default for backward compatibility. It was introduced by CGA cards, and on those it was not merely the default and could not be changed; it was hardwired. (CGA cards did not have any way to display a color given arbitrary red/green/blue values. They *only* had the sixteen colors, ever, period. As an added bonus, you could only get more than four of them on the screen at once in text mode (although there were tricks available to make text mode appear to be a low-res graphics mode).)

      I was pretty sure the CGA colors also match the ANSI colors, but I shouldn't be surprised that the VT100 used a different scheme; DEC did a lot of things differently from the rest of the world, such as using Category 4 (not 3, not 5) cable and MMJ connectors for networking, or the extraordinarily wacky way VMS expresses directory paths.

        It was introduced by CGA cards, and on those it was not merely the default and could not be changed; it was hardwired.

        Yes, you are right in this one. I do not know which of these numbering schemes was the first, any of them might predate ansi or vt100 terminals or cga cards as far as I know. (ZX spectrum seems to use 0=black, 1=blue, 2=red, 3=magenta, 4=green if this emulator is right.)

        As an added bonus, you could only get more than four of them on the screen at once in text mode (although there were tricks available to make text mode appear to be a low-res graphics mode).

        (Update: I was wrong here, see jonadab's reply) I think this is wrong. There is a low-resolution color mode of size 160x100 pixels (lines are doubled), 16 colors. That mode, however, is not supported by the bios, and the resoultion is very small (that's easy to say now, sitting at an 1280x1024 tft screen, mind you), so I guess only few programs used it.

Re^2: When I count, I think of numbers as...
by Yer Mom (Pilgrim) on Jun 02, 2005 at 12:27 UTC
    Surely black, brown, red, orange, yellow, green, blue, violet, grey, white?

    Or have I read one RS catalogue too many?

      You really don't want to know the mnemonic my high school physics teacher gave us to remember the color codes on resistors.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://461489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-04-21 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (492 votes), past polls