Path: news.daimi.aau.dk!not-for-mail From: "Jorgen Lindskov Knudsen" Newsgroups: comp.lang.beta Subject: Re: colors Date: Wed, 6 May 1998 23:16:45 +0200 Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 39 Message-ID: <6iqjvv$hbg$1@nf.aau.dk> References: <35505DA1.175C@tonno3.informatik.uni-dortmund.de> NNTP-Posting-Host: isdn-002.daimi.aau.dk X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Xref: news.daimi.aau.dk comp.lang.beta:11563 If you prefer to work with colors in the HSV color cube, there are color convertion utilities in the 'colorConverter' library in guienv/utils. Also, there is a 'colorTable' abstraction in guienv/utils which alows you to deal with named colors, such as 'LightBlue'. --- jlk Morten Grouleff wrote in message ... >pkb107 writes: > >> how can I use predefined colors or define colors on my own? there is a >> color 'class' (integer red, green, blue), but what are the ranges for >> these numbers ? what happens if my display only offers 256 (prolly >> indexed) colors? will the compiler convert colors or will they be >> adjusted at run-time ? > >'Color' in guienv is just a tuple of 3 integers representing the (Red, >Green, Blue) parts of the RGB value of the color. They are unsigned >integers ranging 0 through 65535 (2^16-1). This should work for all >platforms. The number of colours available depends on the platform, >though. > >(# red,green,blue, white: @Color; >do (65535, 0, 0) -> red; > (0, 65535, 0) -> green; > (0, 0, 65535) -> blue; > (65535, 65535, 65535) -> white; >#) > >If you prefer other representations of colors, take a look at Bifrost. > >Regards, >-- >** Morten Grouleff ** >** Earthworm Jim PC: ** >** "Nick Nolte er ret god til at spille Ulf Pilgaard" **