Thread: colors

  1. #1
    Un Artiste Extraordinaire volk's Avatar
    Join Date
    Dec 2002
    Posts
    357

    Question colors

    How many different ways are there to change the text and background colors of your output? It varies based on the compiler you're using, right? I'm using Microsoft's Visual C++.

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    162
    whatever RGB you can come up with is the limit.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    How about a felt-tip pen? All the colours of the rainbow, and more...

    I'm sure there's a better reference in MSDN somewhere, but here's one for now:
    http://msdn.microsoft.com/library/de...tive_cells.asp
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Un Artiste Extraordinaire volk's Avatar
    Join Date
    Dec 2002
    Posts
    357
    Is there any real purpose to changing the text and background colour...I mean color (hehe, I'm making fun of hammer)?

    It seems that feature is only used for fun. Do serious programmers really use it?

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>hehe, I'm making fun of hammer
    What you talkin 'bout? It was me that spelt it correctly

    >>Do serious programmers really use it?
    Sure, if you don't set the background colour yourself, who knows what colour it will be. If you've changed the foreground only, your text may become invisible.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Un Artiste Extraordinaire volk's Avatar
    Join Date
    Dec 2002
    Posts
    357

    It was me that spelt it correctly
    Didnt' you mean to say, "It was I who indeed spelt it incorrectly"?


    Sure, if you don't set the background colour yourself, who knows what colour it will be.
    What do you mean? Isn't the background black with white text by default?

    When I first started programming, I didn't remember my book saying anything about setting the proper colors to make sure my "hello world" program had a black background with white text.

  7. #7
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    A user has the ability to customize the colours that are used in the Windows console. Thus, you never do know what the colours will be, unless you set them yourself.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  8. #8
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >> Isn't the background black with white text by default
    Yes, maybe, but the user can change their console window default at the click of a button. Besides, I took this as a more general question, meaning anykind of console style programming (eg *nix curses included).

    [edit]
    Doh, I spent so long thinking of a witty reply, I got beat to the answer.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why I only get 8 colors out of ncurses?
    By Nazgulled in forum C Programming
    Replies: 3
    Last Post: 05-08-2007, 06:06 PM
  2. Relation between material colors and light colors.
    By indigo0086 in forum Game Programming
    Replies: 3
    Last Post: 04-18-2007, 03:20 PM
  3. colors in forefox and colors in IE
    By MisterSako in forum Tech Board
    Replies: 3
    Last Post: 05-15-2006, 01:59 PM
  4. colors?
    By planet_abhi in forum Game Programming
    Replies: 1
    Last Post: 09-10-2003, 05:37 PM
  5. Text Colors
    By GaPe in forum C Programming
    Replies: 1
    Last Post: 07-11-2002, 06:57 AM