I have come across a code snippet which I am unable to understand - the
color statement - Can anybody help me understand this thing ? What does
these so many RGB means in the deffinition ?

MODIFY WINDOW lw_invoice NOGROW ;
COLOR RGB(0,0,0,192,192,192), ;
RGB(0,0,0,255,255,255),,,,,,,, ;
RGB(0,0,0,192,192,192) ;
FONT "Courier New", 9

Re: What does this mean ? by Jack

Jack
Thu Aug 18 00:33:04 CDT 2005

On Thu, 18 Aug 2005 21:03:55 -0700, "Tanveer H. Malik"
<tanmalik@hotmail.com> wrote:

>I have come across a code snippet which I am unable to understand - the
>color statement - Can anybody help me understand this thing ? What does
>these so many RGB means in the deffinition ?
>
>MODIFY WINDOW lw_invoice NOGROW ;
> COLOR RGB(0,0,0,192,192,192), ;
> RGB(0,0,0,255,255,255),,,,,,,, ;
> RGB(0,0,0,192,192,192) ;
> FONT "Courier New", 9

I have seen an explanation for this, but can't find it now. I believe
this is a holdover from FPD which still works.

As I recall, each RGB() is a pair of foreground and background colors.
Each set is usef for a specific purpose (menu item, selected menu
item, etc.), but I can't find the documentation that describes what
each one controls.


Re: What does this mean ? by Jan

Jan
Thu Aug 18 01:41:48 CDT 2005

From FPW help:
----
COLOR SCHEME <expN2>
| COLOR <color pair list>
The color of user-defined windows can be specified by including the
number of an existing color scheme in the COLOR SCHEME clause or a set
of color pairs in the COLOR clause.

A color scheme is a set of 10 predefined color pairs. The color pairs
in a color scheme can be changed with SET COLOR OF SCHEME. In FoxPro
for MS-DOS the color pairs in a color scheme can also be changed in the
Color Picker.

A color pair is a set of two letters separated by a forward slash. The
first color letter specifies the foreground color and the second letter
specifies the background color.

For example, this color pair specifies a red foreground on a white
background:

R/W

For a list of colors and their corresponding color letters, see the SET
COLOR commands or the Color Table by Color Pair topic in this online
help facility.

A color pair can also be specified with a set of 6 RGB (Red Green Blue)
color values separated by commas. The first 3 color values specify the
foreground color and the second 3 color values specify the background
color. The color values can range from 0 through 255.

The R/W color pair in the example above can also be specified with this
RGB color pair:

RGB(255,0,0,255,255,255)

By default, the colors of windows created with DEFINE WINDOW are
controlled by color scheme 1.

----


Tanveer H. Malik napsal(a):
> I have come across a code snippet which I am unable to understand - the
> color statement - Can anybody help me understand this thing ? What does
> these so many RGB means in the deffinition ?
>
> MODIFY WINDOW lw_invoice NOGROW ;
> COLOR RGB(0,0,0,192,192,192), ;
> RGB(0,0,0,255,255,255),,,,,,,, ;
> RGB(0,0,0,192,192,192) ;
> FONT "Courier New", 9
>
>

Re: What does this mean ? by Tanveer

Tanveer
Thu Aug 18 12:03:31 CDT 2005


Only the First RGB(0,0,0,255,255,255) is understandable, which mean first
three digits are for the forecolor and the last three digits represent the
background color of the windows .. all the rest RGB(..) no clue what does
they mean to the window definition ??


"Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
news:%23fT6zo6oFHA.2180@TK2MSFTNGP15.phx.gbl...
>
> I have come across a code snippet which I am unable to understand - the
> color statement - Can anybody help me understand this thing ? What does
> these so many RGB means in the deffinition ?
>
> MODIFY WINDOW lw_invoice NOGROW ;
> COLOR RGB(0,0,0,192,192,192), ;
> RGB(0,0,0,255,255,255),,,,,,,, ;
> RGB(0,0,0,192,192,192) ;
> FONT "Courier New", 9
>
>
>




Re: What does this mean ? by Dan

Dan
Thu Aug 18 14:06:31 CDT 2005

There were approx. a dozen (this is a memory from LONG ago) color pairs,
making up a color scheme, that could be used in DEFINE WINDOW. It's been so
long since I've used it I'm very hazy on it.

There are some people here still using FPW, so perhaps one of those kind
souls will post the text from the DEFINE WINDOW help topic from FPW?

Dan


Tanveer H. Malik wrote:
> Only the First RGB(0,0,0,255,255,255) is understandable, which mean
> first three digits are for the forecolor and the last three digits
> represent the background color of the windows .. all the rest RGB(..)
> no clue what does they mean to the window definition ??
>
>
> "Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
> news:%23fT6zo6oFHA.2180@TK2MSFTNGP15.phx.gbl...
>>
>> I have come across a code snippet which I am unable to understand -
>> the color statement - Can anybody help me understand this thing ?
>> What does these so many RGB means in the deffinition ?
>>
>> MODIFY WINDOW lw_invoice NOGROW ;
>> COLOR RGB(0,0,0,192,192,192), ;
>> RGB(0,0,0,255,255,255),,,,,,,, ;
>> RGB(0,0,0,192,192,192) ;
>> FONT "Courier New", 9



Re: What does this mean ? by Rick

Rick
Thu Aug 18 15:27:35 CDT 2005

Tanveer,
Based on some old documentation I still have, the following should "explain" it.
(Remember that this was for FoxPro DOS and mostly worked the same in FPW and
VFP.)

POSITION SCHEME 1 - USER WINDOW
----------------------------------------------------------------------------
1st ? & SAY Field

2nd GET Field

3rd Border

4th Title - Active

5th Title - Idle

6th Selected Item


Rick

"Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
news:%23kKOQbBpFHA.2976@TK2MSFTNGP12.phx.gbl...
>
> Only the First RGB(0,0,0,255,255,255) is understandable, which mean first
> three digits are for the forecolor and the last three digits represent the
> background color of the windows .. all the rest RGB(..) no clue what does they
> mean to the window definition ??
>
>
> "Tanveer H. Malik" <tanmalik@hotmail.com> wrote in message
> news:%23fT6zo6oFHA.2180@TK2MSFTNGP15.phx.gbl...
>>
>> I have come across a code snippet which I am unable to understand - the color
>> statement - Can anybody help me understand this thing ? What does these so
>> many RGB means in the deffinition ?
>>
>> MODIFY WINDOW lw_invoice NOGROW ;
>> COLOR RGB(0,0,0,192,192,192), ;
>> RGB(0,0,0,255,255,255),,,,,,,, ;
>> RGB(0,0,0,192,192,192) ;
>> FONT "Courier New", 9
>>
>>
>>
>
>
>


Re: What does this mean ? by Andrew

Andrew
Fri Aug 19 02:25:09 CDT 2005

"Dan Freeman" <spam@microsoft.com> wrote in message
news:%2302dzfCpFHA.3756@TK2MSFTNGP09.phx.gbl...
> There were approx. a dozen (this is a memory from LONG ago) color pairs,
> making up a color scheme, that could be used in DEFINE WINDOW. It's been
> so
> long since I've used it I'm very hazy on it.
>
> There are some people here still using FPW, so perhaps one of those kind
> souls will post the text from the DEFINE WINDOW help topic from FPW?

This is the help entry called "colors" from FPW2.6 help. At the bottom it
seems to cover which colour pair numbers affect what part of various
objects. I think the section "User defined windows (Scheme 1)" is what
applies to you.
Sorry, I've lost the text formatting, I tried to paste as HTML or something
but no joy.

Hope this helps.

}-----------------------------------
FoxPro offers a sophisticated set of commands for full control of colors.

By default, FoxPro for Windows and FoxPro for Macintosh take their colors
from the Control Panel settings. The Control Panel colors are mapped to the
FoxPro color schemes. The colors can be overwritten using the FoxPro SET
COLOR commands described in this section.
In FoxPro for Windows and FoxPro for Macintosh, you can set colors directly
with the SET COLOR commands or interactively in the Control Panel. Refer to
your Windows or Macintosh documentation for more information about setting
colors with the Control Panel.
In FoxPro for MS-DOS, you can define the colors of elements of the FoxPro
system interface (the system menu bar, windows, alerts, dialogs, and so on)
and user-defined objects (controls, menus, windows, and so on). You can set
colors directly with the SET COLOR commands or interactively with the Color
Picker dialog, which is available by choosing Color... from the Window menu.
The Color Picker dialog provides the fastest way to set colors and allows
you to save color sets for later use. See the FoxPro User's Guide for more
information on setting colors with the Color Picker dialog see the "Window
Menu" chapter in the FoxPro for MS-DOSUser's Guide.
Certain commands, like DEFINE WINDOW, support optional COLOR and COLOR
SCHEME clauses that let you specify colors of user-defined objects directly.
We recommend that you let Windows handle all coloring issues. Refer to the
Microsoft Windows manuals for more information on setting colors through the
Color dialog.
If you prefer to set a different default set of colors when FoxPro is
started, you can programmatically create and save your own custom default
color set using the CREATE COLOR SET DEFAULT command. Use this default
color set by specifying it in the FoxPro CONFIG.FPW configuration file.

The following topics contain more information on colors:

Color Pairs
Color Schemes
Color Table by Color Pair
How Windows Colors are Mapped into FoxPro

Color Pairs

A color pair consists of a foreground and background color combination.
FoxPro uses eight basic colors: red, green, blue, cyan, magenta, yellow,
white and black. Each color has two intensity levels: low intensity (dark)
and high intensity (bright).
You can specify color pairs using either of two methods:

Character color codes
RGB color codes

Each method is described in detail below.

Character Code Color

FoxPro for MS-DOS uses character abbreviations (R, G, B, W, N) for color
values. Each color can have an attribute to change the intensity level.
Color codes that contain the plus sign (+) denote a bright foreground.
Similarly, color codes that contain the asterisk (*) denote a bright
background.
The plus sign (+) and the asterisk (*) can be placed anywhere in the color
pair.

Character Code Example

The following example shows the character color code for red on dark gray
(high intensity black):

R+/N

You could also use any of the following to specify the same color code:

+R/N
R/N+
R/+N

Remember that both signs (+,*) denote high intensity (or brightness). The
plus sign (+) denotes foreground intensity, and the asterisk (*) denotes
background intensity no matter where they are located in the expression.
FoxPro for Windows supports the character codes for color. These codes,
however, are internally converted to the RGB system when program code is
generated and compiled.

RGB Color Pairs

You can also specify colors the RGB color values. These values range from 0
(lowest intensity or no color) to 255 (high intensity or bright color).
Each foreground and background requires three values, one for red, one for
green, and one for blue. A color pair, therefore, requires six values,
three for the foreground and three for the background.

RGB Example

The following example shows the RGB color code for red on dark gray (high
intensity black):

RGB(255,0,0,128,128,128)

The first three values in the RGB expression above set the foreground color
to red and the second three values set the background color to dark gray
(see the table below).
FoxPro uses a different color representation for the Windows version than it
does for the MS-DOS version. Both FoxPro for MS-DOS and FoxPro for Windows
accept the RGB and character color codes. Each of the color representations
are described in sections that follow.
The following is a table of the colors that are available in FoxPro for
MS-DOS, including the character codes and the corresponding RGB codes for
FoxPro for Windows.

Color RGB Foreground Background
White 255,255,255 W+ W*
Black 0,0,0 N N
Gray 192,192,192 W W
Dark Gray 128,128,128 N+ N*
Red 255,0,0 R+ R*
Dark Red 128,0,0 R R
Yellow 255,255,0 GR+ GR*
Dark Yellow 128,128,0 GR GR
Green 0,255,0 G+ G*
Dark Green 0,128,0 G G
Cyan 0,255,255 BG+ BG*
Dark Cyan 0,128,128 BG BG
Blue 0,0,255 B+ B*
Dark Blue 0,0,128 B B
Magenta 255,0,255 RB+ RB*
Dark Magenta 128,0,128 RB RB
Blank N/A X X
When you use custom colors, the following rules apply for converting RGB
values into character codes:

When ALL of the three color values (R, G or B) are below 32, the character
code is N.
When ALL of the three color values (R, G or B) are between 32 and 64, the
character code is N+.
When ALL of the three color values (R, G or B) are between 65 and 191, the
character code is W.
When ANY of the three color values (R, G or B) are above 191 the character
code is high intensity (+ or *).

Examples

R G B Character
100 80 175 W
100 200 175 W+/*
33 56 45 N+/*
33 56 175 B
33 56 245 B+/*
100 100 3 GR
Color Pair List

A color pair list consists of one to ten color pairs separated by commas. A
color scheme is composed of ten color pairs. For example, W+/B, W+/BG,
GR+/B, GR+/B, R+/B, W+/GR, GR+/RB, N+/N, GR+/B, R+/B. A monochrome color
pair list might look like W/N, N+/W, W+/N, W+/N, W/N, U+/N, W+/N, -, W+/N,
W/N.

Color Schemes

A color scheme is a set of ten color pairs. Each color pair in a color pair
list corresponds to an item in a color scheme. The color pair list for a
color scheme can be returned with SCHEME( ) or RGBSCHEME( ).
A user-defined object (GET, check box, list, push button) takes on the color
scheme of the window it is drawn in. A user-defined menu takes on the
colors of scheme 2. You can override the default scheme of a user defined
object by including the color scheme clause with the command. The following
commands support the color scheme clause:

@ ... EDIT - Text Edit Regions
@ ... FILL
@ ... GET
@ ... GET - Check boxes
@ ... GET - Invisible buttons
@ ... GET - Lists
@ ... GET - Popups
@ ... GET - Push Buttons
@ ... GET - Radio Buttons
@ ... SAY
@ ... TO
BROWSE
CHANGE
DEFINE BAR
DEFINE MENU
DEFINE PAD
DEFINE POPUP
DEFINE WINDOW
EDIT
SHOW GET
SHOW OBJECT

Color Set

A color set consists of 24 color schemes. The complete color environment
can be saved in a color set. Color sets, like keyboard macros and memory
variables, can be saved for later use. A color set can be assigned a name
of up to ten characters and saved. Color sets are stored in the FOXUSER.DBF
resource file. You can load a color set with SET COLOR SET.
Commands and functions you can use to manipulate color schemes include:


RGBSCHEME( ) Function
SCHEME( ) Function
SET COLOR OF SCHEME Command
SET COLOR SET Command


How Windows Colors are Mapped into FoxPro

User Defined Windows (Scheme 1)
User Defined Menus (Scheme 2)
Menu Bar (Scheme 3)
Menu Popups (Scheme 4)
Dialogs (Scheme 5)
Dialog Popups (Scheme 6)
Alert (Scheme 7)
Window (Scheme 8)
Window Popups (Scheme 9)
Browse (Scheme 10)
Report (Scheme 11)
Alert Popups (Scheme 12)

User Defined Windows (Scheme 1)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Application Workspace
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
User Defined Menus (Scheme 2)

Color Pair Windows Element
1 Menu text/Menu bar
2 Window text/Menu bar
3 Window Frame/Menu bar
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Menu text/Menu bar
10 Disabled text/Menu bar
Menu Bar (Scheme 3)

Color Pair Windows Element
1 Menu text/Menu bar
2 Window text/Menu bar
3 Window Frame/Menu bar
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Menu text/Menu bar
10 Disabled text/Menu bar
Menu Popups (Scheme 4)

Color Pair Windows Element
1 Menu text/Menu bar
2 Window text/Menu bar
3 Window Frame/Menu bar
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Menu text/Menu bar
10 Disabled text/Menu bar
Dialogs (Scheme 5)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Window background
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Dialog Popups (Scheme 6)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Window background
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Alert (Scheme 7)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Application Workspace
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Window (Scheme 8)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Application Workspace
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Window Popups (Scheme 9)

Color Pair Windows Element
1 Menu text/Menu bar
2 Window text/Menu bar
3 Window Frame/Menu bar
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Menu text/Menu bar
10 Disabled text/Menu bar
Browse (Scheme 10)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Application Workspace
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Report (Scheme 11)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Window background
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Alert Popups (Scheme 12)

Color Pair Windows Element
1 Window text/Window background
2 Window text/Window background
3 Window Frame/Window Background
4 Active title bar text/Active title bar
5 Inactive title bar text/Inactive title bar
5 For Windows 3.0: Active title bar text/Inactive title bar
6 Highlighted text/Highlight
7 Highlighted text/Highlight
8 No mapping
9 Window text/Window background
10 Disabled text/Window background
Color Table by Color Pair

Color Code

Black N
Blank X
Blue B
Brown GR
Cyan BG
Green G
Magenta RB
Red R
White W
Yellow GR+

On monochrome monitors, only four "colors" are available: white (W), black
(N), underlined (U) and inverse video (I).
An asterisk (*) can be added to make the background color bright. A plus
sign (+) denotes high intensity for the foreground color.
Color pairs can also be specified with a set of 6 RGB (Red Green Blue) color
values separated by commas. The first three color values specify the
foreground color and the second three color values specify the background
color. The color values can range from 0 through 255.
For example, the color pair R/W can also be specified with this RGB color
pair:

RGB(255,0,0,255,255,255)

In FoxPro for Windows, you can set colors directly with the SET COLOR
commands or interactively in the Windows Control Panel. For more
information about colors in FoxPro for Windows, see Colors.

--
Regards
Andrew Howell



Re: What does this mean ? by Dan

Dan
Fri Aug 19 10:57:53 CDT 2005

MY EYES! MY EYES! <g>

Brings back a flood of memories. Blaise Mitsutama wrote an article for
Foxtalk exploring color schemes that was so long it had to be split over two
issues even after heavy editing.

(and thanks for posting the help text -- I was actually thinking of you when
I made the suggestion. <g>)

Dan


Andrew Howell wrote:
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:%2302dzfCpFHA.3756@TK2MSFTNGP09.phx.gbl...
>> There were approx. a dozen (this is a memory from LONG ago) color
>> pairs, making up a color scheme, that could be used in DEFINE
>> WINDOW. It's been so
>> long since I've used it I'm very hazy on it.
>>
>> There are some people here still using FPW, so perhaps one of those
>> kind souls will post the text from the DEFINE WINDOW help topic from
>> FPW?
>
> This is the help entry called "colors" from FPW2.6 help. At the
> bottom it seems to cover which colour pair numbers affect what part
> of various objects. I think the section "User defined windows (Scheme
> 1)" is what applies to you.
> Sorry, I've lost the text formatting, I tried to paste as HTML or
> something but no joy.
>
> Hope this helps.