🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6012

Re: How to mix colors in Turbo C ???

#6012
From: Brian K. W. Hook
Date: Tue, 30 Apr 1991 17:35
23 lines
1678 bytes
I don't think mixing colors is going to be as easy as using setcolor().
Setcolor takes an enumed integer from 0-15, I believe (may be different for
the 256color BGI).  If you look in <graphics.h> you will see that the color
values are in fact enumerated.  Thus, ORing them won't work.

If you are in a 16 color mode with an EGA/VGA board, you would have to
probably remap your pallete using remappallete() or setpalette(), can't
remember which is the correct name.  This reduces the amount of available
colors though (since if you have 8 shades of grey, you can still only have
8 more other colors).  This is how EA gets that lifelike King Tut picture
using an EGA.  They remap the colors to pretty much all shades of
yellow/gold.

If you don't want to reduce the amount of colors available, you must resort
to dithering.  The crude method would be to use setlinestyle() and
setfillmask().  But if you would like to be sophisticated about it, try
getting a good book on graphics that covers dithering.

If you are using 256 color VGA, you probably have the 256 color BGI, and
then you are set.  I have never used this BGI, so I can't say much about
it.

Brian
Technical Details
Message-ID: <28321@uflorida.cis.ufl.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!noao!ncar!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!uflorida!reef.cis.ufl.edu!jdb
References: <2530@pdxgate.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!noao!ncar!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!uflorida!reef.cis.ufl.edu!jdb
From: jdb@reef.cis.ufl.edu (Brian K. W. Hook)
Newsgroups: comp.os.msdos.programmer
Subject: Re: How to mix colors in Turbo C ???
Message-ID: <28321@uflorida.cis.ufl.EDU>
Date: 30 Apr 91 17:35:23 GMT
References: <2530@pdxgate.UUCP>
Sender: news@uflorida.cis.ufl.EDU
Organization: UF CIS Dept.
Lines: 23