WINDOW BACKCOLOR

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
CCH4CLIPPER
Posts: 130
Joined: Tue Mar 03, 2009 8:59 am

WINDOW BACKCOLOR

Post by CCH4CLIPPER » Mon Mar 09, 2009 12:33 pm

Hi All

From hmg_help.chc
[ BACKCOLOR <anBackColor> ]

What are the valid values of anBackColor ?

Say, I wan the color TEAL, what would be the value ?


CCH
http://cch4clipper.blogspot.com

User avatar
esgici
Posts: 4446
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 332 times
Been thanked: 101 times
Contact:

Post by esgici » Mon Mar 09, 2009 1:01 pm

CCH4CLIPPER wrote:Hi All

From hmg_help.chc
[ BACKCOLOR <anBackColor> ]

What are the valid values of anBackColor ?

Say, I wan the color TEAL, what would be the value ?


CCH
http://cch4clipper.blogspot.com
Hi CCH

<anBackColor> is a array with three numeric values in range 0-255 ( RGB Color values )

You may use some predefined color constants ( please see C:\hmg\INCLUDE\i_color.ch ) and of course you may define your own color constant same way. f.e.

Code: Select all

#define ALICEBLUE  { 240, 248, 255 }
#define ANTICWHITE { 250, 265, 215 }
#define AQUA       {   0, 128,   0 }
#define AZURE      { 240, 255, 255 }  
#define BEIGE      { 245, 245, 220 }
#define BISQUE     { 255, 228, 196 }
#define BLANCH     { 255, 235, 205 }
#define BLUEVIOLET { 138,  43, 226 }
#define BURLYWOOD  { 222, 184,  87 } 
#define BROWN_2    { 165,  42,  42 }
#define CADETBLUE  {  95, 158, 160 }
#define CORNBLEU   { 100, 149, 237 } 
#define CORNSILK   { 255, 248, 220 } 
#define CYAN       {   0, 255, 255 }
#define CYANBUNE   { 190, 210, 230 }
#define DARKBLUE   {   0,   0, 139 }
#define DARKCYAN   {   0, 139, 139 }
#define DARKKHAKI  { 189, 183, 107 } 
#define DARKGRAY   { 169, 169, 169 }
#define DARKGREEN  {   0, 100,   0 }
#define DARKRED    { 139,   0,   0 }
#define GREEN_2    {   0, 128,   0 }
#define KHAKI      { 240, 230, 140 }
#define LIME       {   0, 255,   0 }  // GREEN 
#define MAROON     { 128,   0,   0 }
#define NAVY       {   0,   0, 128 }
#define OLIVE      { 128, 128,   0 }
#define ORANGE     { 255, 165,   0 }
#define SILVER     { 192, 192, 192 }
#define TEAL       {   0, 128, 128 }
#define TURQUOISE  {  64, 224, 208 }
You may found RGB Color values and its combinations anywhere in the Internet.

As an example, you may get information / utilize by attached sample. ( It's available also at http://vivaclipper.googlepages.com/ColorCodes.zip )


Regards

--

esgici
Attachments
ColorCodes.zip
HMP Sample for select color codes
(2.49 KiB) Downloaded 213 times
Last edited by esgici on Fri Nov 04, 2011 5:17 pm, edited 1 time in total.
Viva INTERNATIONAL HMG :D

CCH4CLIPPER
Posts: 130
Joined: Tue Mar 03, 2009 8:59 am

Post by CCH4CLIPPER » Mon Mar 09, 2009 1:36 pm

Hi Escigi

I added #include "i_color.ch" which include
#define FUCHSIA { 255 , 0 , 255 }

and use BACKCOLOR FUSCHIA

When I use HMGIDE to compile and link, I get Base/1003, Variable does not exist FUSCHIA

What am I doing wrong ?


CCH
http://cch4clipper.blogspot.com

User avatar
esgici
Posts: 4446
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 332 times
Been thanked: 101 times
Contact:

Post by esgici » Mon Mar 09, 2009 2:59 pm

CCH4CLIPPER wrote: I added #include "i_color.ch" which include
#define FUCHSIA { 255 , 0 , 255 }

and use BACKCOLOR FUSCHIA

When I use HMGIDE to compile and link, I get Base/1003, Variable does not exist FUSCHIA

What am I doing wrong ?


CCH
Hi CCH

Defined as : FUCHSIA ...

used as : ... FUSCHIA

BTW, you don't have add #include "i_color.ch"; it's standard HMG .ch file, always added by default. So you can use color codes defined it, without #include.

You may build a separate .ch file such as "myColrCons.ch" with desired color constants (such as TEAL and anything else) and add #include "myColrCons.ch" in your prgs.

Regards

--

esgici
Viva INTERNATIONAL HMG :D

CCH4CLIPPER
Posts: 130
Joined: Tue Mar 03, 2009 8:59 am

Post by CCH4CLIPPER » Tue Mar 10, 2009 12:40 am

Hi Escigi

Thanx !

CCH
http://cch4clipper.blogspot.com

Post Reply