[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Colours in general..

From: Mike Aubury
Subject: Colours in general..
Date: Wed, 18 Jun 2003 16:10:58 +0100

When using KDE, I get a white background.
Using the normal Linux console - its black...

So if I want to use colours, don't I need to know the background colour first 
(I may well be missing something here!)


If its a white background :

// And of course - the COLOR_WHITE here is just a slightly darker shade than 
the background!

  init_pair (1, COLOR_WHITE, COLOR_WHITE);
  init_pair (2, COLOR_RED, COLOR_WHITE);
  init_pair (3, COLOR_GREEN, COLOR_WHITE);
  init_pair (4, COLOR_YELLOW, COLOR_WHITE);
  init_pair (5, COLOR_BLUE, COLOR_WHITE);
  init_pair (6, COLOR_MAGENTA, COLOR_WHITE);
  init_pair (7, COLOR_CYAN, COLOR_WHITE);
  init_pair (8, COLOR_BLACK, COLOR_WHITE);

If its a black background :

  init_pair (1, COLOR_BLACK, COLOR_BLACK);
  init_pair (2, COLOR_RED, COLOR_BLACK);
  init_pair (3, COLOR_GREEN, COLOR_BLACK);
  init_pair (4, COLOR_YELLOW, COLOR_BLACK);
  init_pair (5, COLOR_BLUE, COLOR_BLACK);
  init_pair (6, COLOR_MAGENTA, COLOR_BLACK);
  init_pair (7, COLOR_CYAN, COLOR_BLACK);
  init_pair (8, COLOR_WHITE, COLOR_BLACK);

Or something similar...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]