Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

Specifying colours.

I was sent a procedure that allowed me to specify the red green and blue of a color. unfortunatly, all I have is a scribbled down copy of it and I cant seem to make it work, can someone tell me if the following is correct and how to use it:

PROCEDURE Setcolor(Col,R,G,B:Byte);
BEGIN
          port [$03c8] := Col;
          port [$03c9] := R;
          port [$03c9] := G;
          port [$03c9] := B;
END;
0
xizor
Asked:
xizor
1 Solution
 
mesCommented:
I think it should work. Do you use it in textmode or graphmode?

MES.

0
 
omsecCommented:
Hi there !

The procedure is right !

How ya can see, it expects 4 arguments : COL is the number of the VGA - Color you wanna change. R is the part of RED you wanna put into this color, G stands for GREEN and B for blue.

For example :

If ya wanna change color 11 known as LightCyan you have to do it
as followed :

{Text message in normal color 11}
SetColor(11, 15, 32, 19);
{Set color 11 with its new properties again}
{write the message again}

Now you have your own color, defined

Omsec
0
 
xizorAuthor Commented:
but how do i now set the colour of a line?
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now