Thread: color text in C programming

  1. #16
    Registered User
    Join Date
    Aug 2008
    Posts
    8
    So what do you mean. Is that C can't do it by itself?

  2. #17
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,611
    This is a f.a.q.

    Quote Originally Posted by paakfaat View Post
    Thanks Mats, that is my problem. I find many solutions but not greater than 16 colors.
    Terminals are limited to 8-bit color in the first place (16 varieties of color).

    What color do you want your text to be so badly that you can't pick the closest shade?

  3. #18
    Registered User
    Join Date
    Jul 2008
    Posts
    133
    Quote Originally Posted by matsp View Post
    I do believe it is a limitation of how a console works, so the only solution is to implement a completely new console handler - which is substantial work, not to mention that such an application would not be compatible with the current Windows Console executables [although old applications could perhaps be made to run within the new environment, but it would require replacing some pretty basic functionality within Windows itself, which I'm not at all sure is documented enough to be replaced without serious reverse engineering work].

    --
    Mats
    Yes, which is very unfortunate. I guess we will have to live with 3-bit consoles a decade more...

  4. #19
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by rasta_freak View Post
    Yes, which is very unfortunate. I guess we will have to live with 3-bit consoles a decade more...
    Not 3, but 4-bit (ok, so one bit just adjusts the intensity, but it's still 4 bits). And I think for most things, it's adequate. I can actually not think of any reason why you would realistically need more. There are plenty of different choices for doing text mode in many different colours and given more choice would not actually improve applications significantly.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #20
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    Quote Originally Posted by citizen View Post
    Terminals are limited to 8-bit color in the first place (16 varieties of color).
    I wouldn't consider the windows console as a terminal/terminal emulator (and when talking about terminal, talking about, example, the vt100 terminal). I believe it's a bit different, every process can have a console and the console buffers are process specific, and managed by the OS. Anyway. I might be wrong. And, at the end, I don't really care.

    There's a lot of details on MSDN: http://msdn.microsoft.com/en-ca/libr...13(VS.85).aspx
    I hate real numbers.

  6. #21
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Yes, on VT100 you only have five choices (that can be combined however you like): Normal, Intense, Underline, Inverse and Flashing. No colours.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #22
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,611
    If you don't care then why should I?

  8. #23
    Registered User
    Join Date
    Jul 2008
    Posts
    133
    Quote Originally Posted by matsp View Post
    Not 3, but 4-bit (ok, so one bit just adjusts the intensity, but it's still 4 bits). And I think for most things, it's adequate. I can actually not think of any reason why you would realistically need more. There are plenty of different choices for doing text mode in many different colours and given more choice would not actually improve applications significantly.

    --
    Mats
    Imagine aalib on 8-bit color terminal (you could probably read movie subtitles from immediate proximity)

  9. #24
    Registered User
    Join Date
    Aug 2008
    Posts
    8
    Ok, I understand. I'm just a student who is learning C language and I want my program to be more colorful. So that I started to ask this question in different forums and using different search engies. I did see VT100 before. But I don't know what is ti at all. Other than this, I also read information about curses and conio2 but they just give me 16 colors. As I want to write a c programming homework with more colors to attract others. So I asked this questions. Now, I understand that the window's console is only 4bit. And no more colors can be used. So, thank you very much for help me to answer this question. Although, I still don't understand much about it, but it seems to be a good answer. Thank you again.

Popular pages Recent additions subscribe to a feed