delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/17/05:20:30

Message-ID: <D1FB30BBA491D1118E6D006097BCAE390B91EE@Probe-nt-2a.Probe.co.uk>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Allegro palette construction
Date: Tue, 17 Feb 1998 10:17:19 -0000
MIME-Version: 1.0

John Kissell writes:
> New to DJGPP and Allegro, I've allways relied on commercial
> compilers' predefined color #defines for a given screen mode. Is there
a
> FAQ or URL where I could learn more about how to go about constructing
> color palettes in Allegro? Which values represent cyan or light red in
> 640 x 480, 16 bit VGA, or dark blue in 24 bit true color, for example?

It isn't totally clear whether you are using a 256 color or a truecolor
resolution, and the method for specifying colors is totally different
depending on this.

In a 256 color mode, the appearance of each color value depends entirely
on how you have set up your palette, so you can map each number to
whatever color you like. Usually people will read their palette data
from an image file or a datafile object, but you can also construct
one within your code. This is demonstrated in several of the example
programs: I don't have the files here to check exactly which one, but
I think it is ex3 or ex4.

In a truecolor mode, there are again no fixed values because the color
layout can vary from one graphics card to another. You should use the
makecol() function to construct colors in the appropriate format for
the current video mode.

	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019