Revision history for KeyPgColor


Revision [22550]

Last edited on 2019-01-13 18:50:53 by JeffMarshall [example updated from repo]
Additions:
#include "fbgfx.bi"
'' screencontrol expects integer/uinteger
Dim As UInteger fgcolor, bkcolor
ScreenRes 500, 500, 32
Deletions:
#Include "fbgfx.bi"
Dim As ULong fgcolor, bkcolor
Screenres 500, 500, 32


Revision [22526]

Edited on 2018-11-23 14:49:09 by MrSwiss [example updated from repo]
Additions:
Dim As ULong fgcolor, bkcolor
Deletions:
Dim As Integer fgcolor, bkcolor


Revision [21420]

Edited on 2016-04-27 04:29:58 by fxm [Added example]
Additions:
Print " Foreground Color: "; Hex(Color(), 8)
Deletions:
Print " Foreground Color: "; Hex(Color, 8)


Revision [21419]

Edited on 2016-04-27 04:25:48 by fxm [Added example]
Additions:
{{fbdoc item="filename" value="examples/manual/gfx/color2.bas"}}%%(freebasic)
' In 32-bit color depth, Function Color() returns only the foreground color
#Include "fbgfx.bi"
Dim As Integer fgcolor, bkcolor
Screenres 500, 500, 32
Width 500\8, 500\16
Color &HFFFF00, &H0000FF
Cls
Print "From Function Color():"
Print " Foreground Color: "; Hex(Color, 8)
Print
ScreenControl FB.GET_COLOR, fgcolor, bkcolor
Print "From Sub ScreenControl():"
Print " Foreground Color: "; Hex(fgcolor, 8)
Print " Background Color: "; Hex(bkcolor, 8)
Sleep


Revision [21418]

Edited on 2016-04-26 15:19:34 by fxm [Added reference to ScreenControl]
Additions:
Returns a 32-bit value containing the current foreground color in the ##[[KeyPgLoWord|low word]]## and the current background color in the ##[[KeyPgHiword|high word]]##.
In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits. Instead, see ##[[KeyPgScreencontrol|ScreenControl]]## to return the current graphics mode color (foreground and background).

A ##[[GfxDefPalettes|Default Palette]]## is automatically set when entering a ##[[KeyPgScreengraphics|Screen]]## mode.
Deletions:
Returns a 32-bit value containing the current foreground color in the [[KeyPgLoWord|low word]] and the current background color in the [[KeyPgHiword|high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
A [[GfxDefPalettes|Default Palette]] is automatically set when entering a ##[[KeyPgScreengraphics|Screen]]## mode.


Revision [20092]

Edited on 2016-02-10 15:55:43 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Color** ( [[KeyPgByval|byval]] //foreground// [[KeyPgAs|as]] [[KeyPgUlong|ulong]] , [[KeyPgByval|byval]] //background// [[KeyPgAs|as]] [[KeyPgUlong|ulong]] ) [[KeyPgAs|as]] [[KeyPgUlong|ulong]]
Returns a 32-bit value containing the current foreground color in the [[KeyPgLoWord|low word]] and the current background color in the [[KeyPgHiword|high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
The ##**Color**## statement sets the current foreground and/or background colors. ##[[KeyPgCircle|Circle]]##, ##[[KeyPgDraw|Draw]]##, ##[[KeyPgLinegraphics|Line (Graphics)]]##, ##[[KeyPgCls|Cls]]##, ##[[KeyPgPaint|Paint]]##, ##[[KeyPgPrint|Print]]##, ##[[KeyPgPreset|PReset]]## and ##[[KeyPgPset|PSet]]## all use the last colors set by this function when you don't specify a color to them, where applicable. The color values that ##**Color**## accepts depend on the current graphics mode.
If you are using a color depth higher than 8bpp, foreground and background are direct ##[[KeyPgRgb|RGB]]## color values in the form ##&h//AARRGGBB//##, where ##//AA//##, ##//RR//##, ##//GG//## and ##//BB//## are the alpha, red, green and blue components ranging ##&h00##-##&hFF## (##0##-##255## in decimal notation). While in hi/truecolor modes, you can use the ##[[KeyPgRgb|RGB]]## or ##[[KeyPgRgba|RGBA]]## macro to obtain a valid color value.
A [[GfxDefPalettes|Default Palette]] is automatically set when entering a ##[[KeyPgScreengraphics|Screen]]## mode.
- ##[[KeyPgRgb|RGB]]##
- ##[[KeyPgRgba|RGBA]]##
- ##[[KeyPgLoWord|LOWORD]]##
- ##[[KeyPgHiword|HIWORD]]##
- ##[[KeyPgLocate|Locate]]##
- ##[[KeyPgPalette|Palette]]##
- ##[[KeyPgScreengraphics|Screen]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Color** ( [[KeyPgByval byval]] //foreground// [[KeyPgAs as]] [[KeyPgUlong ulong]] , [[KeyPgByval byval]] //background// [[KeyPgAs as]] [[KeyPgUlong ulong]] ) [[KeyPgAs as]] [[KeyPgUlong ulong]]
Returns a 32-bit value containing the current foreground color in the [[KeyPgLoWord low word]] and the current background color in the [[KeyPgHiword high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
The ##**Color**## statement sets the current foreground and/or background colors. ##[[KeyPgCircle Circle]]##, ##[[KeyPgDraw Draw]]##, ##[[KeyPgLinegraphics Line (Graphics)]]##, ##[[KeyPgCls Cls]]##, ##[[KeyPgPaint Paint]]##, ##[[KeyPgPrint Print]]##, ##[[KeyPgPreset PReset]]## and ##[[KeyPgPset PSet]]## all use the last colors set by this function when you don't specify a color to them, where applicable. The color values that ##**Color**## accepts depend on the current graphics mode.
If you are using a color depth higher than 8bpp, foreground and background are direct ##[[KeyPgRgb RGB]]## color values in the form ##&h//AARRGGBB//##, where ##//AA//##, ##//RR//##, ##//GG//## and ##//BB//## are the alpha, red, green and blue components ranging ##&h00##-##&hFF## (##0##-##255## in decimal notation). While in hi/truecolor modes, you can use the ##[[KeyPgRgb RGB]]## or ##[[KeyPgRgba RGBA]]## macro to obtain a valid color value.
A [[GfxDefPalettes Default Palette]] is automatically set when entering a ##[[KeyPgScreengraphics Screen]]## mode.
- ##[[KeyPgRgb RGB]]##
- ##[[KeyPgRgba RGBA]]##
- ##[[KeyPgLoWord LOWORD]]##
- ##[[KeyPgHiword HIWORD]]##
- ##[[KeyPgLocate Locate]]##
- ##[[KeyPgPalette Palette]]##
- ##[[KeyPgScreengraphics Screen]]##


Revision [17902]

Edited on 2016-01-12 14:17:13 by FxMwikki [In syntax: long => ulong, in example 2: Uinteger => Ulong]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Color** ( [[KeyPgByval byval]] //foreground// [[KeyPgAs as]] [[KeyPgUlong ulong]] , [[KeyPgByval byval]] //background// [[KeyPgAs as]] [[KeyPgUlong ulong]] ) [[KeyPgAs as]] [[KeyPgUlong ulong]]
Dim c As Ulong
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Color** ( [[KeyPgByval byval]] //foreground// [[KeyPgAs as]] [[KeyPgLong long]] , [[KeyPgByval byval]] //background// [[KeyPgAs as]] [[KeyPgLong long]] ) [[KeyPgAs as]] [[KeyPgLong long]]
Dim c As Uinteger


Revision [17484]

Edited on 2015-04-01 11:06:27 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Color** ( [[KeyPgByval byval]] //foreground// [[KeyPgAs as]] [[KeyPgLong long]] , [[KeyPgByval byval]] //background// [[KeyPgAs as]] [[KeyPgLong long]] ) [[KeyPgAs as]] [[KeyPgLong long]]
Returns a 32-bit value containing the current foreground color in the [[KeyPgLoWord low word]] and the current background color in the [[KeyPgHiword high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Color** ( [[KeyPgByval byval]] //foreground// [[KeyPgAs as]] [[KeyPgInteger integer]] , [[KeyPgByval byval]] //background// [[KeyPgAs as]] [[KeyPgInteger integer]] ) [[KeyPgAs as]] [[KeyPgInteger integer]]
Returns a 32 bit ##[[KeyPgInteger Integer]]## containing the current foreground color in the [[KeyPgLoWord low word]] and the current background color in the [[KeyPgHiword high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)


Revision [16144]

Edited on 2012-03-06 13:10:08 by CountingPine [Color return value in full-colour mode]
Additions:
Returns a 32 bit ##[[KeyPgInteger Integer]]## containing the current foreground color in the [[KeyPgLoWord low word]] and the current background color in the [[KeyPgHiword high word]]. (In hi/truecolor modes, only the foreground color is returned, taking up the whole 32 bits.)
The old color values can be retrieved at the same time as setting new ones.
Deletions:
Returns a 32 bit ##[[KeyPgInteger Integer]]## containing the current foreground color in the [[KeyPgLoWord low word]] and the current background color in the [[KeyPgHiword high word]]. The old color values can be retrieved at the same time as setting new ones.


Revision [15745]

Edited on 2012-01-21 17:46:25 by CountingPine [Don't think we need to define the meaning of background outside the range 0 to 3]
Additions:
{{table columns="2" cellpadding="1" cells="Mode;Meaning;1;foreground is screen color (ranging 0-15). background is the emulated CGA palette to be used: 0 (green, red, and brown), 1 (cyan, magenta and white), 2 (same as 0, but with bright colors) or 3 (same as 1, but with bright colors);2, 11;foreground is a color index in current palette (ranging 0-1). background is a color index in current palette (ranging 0-1).;7, 8;foreground is a color index in current palette (ranging 0-15). background is screen color index in current palette (ranging 0-15).;9;foreground is a color index in current palette (ranging 0-63). background is screen color index in current palette (ranging 0-63).;12;foreground is a color index in current palette (ranging 0-15). background is a color index in current palette (ranging 0-15).;13 and up;foreground is a color index in current palette (ranging 0-255). background is a color index in current palette (ranging 0-255)."}}
Deletions:
{{table columns="2" cellpadding="1" cells="Mode;Meaning;1;foreground is screen color (ranging 0-15). background modulo 4 is the emulated CGA palette to be used: 0 (green, red, and brown), 1 (cyan, magenta and white), 2 (same as 0, but with bright colors) or 3 (same as 1, but with bright colors);2, 11;foreground is a color index in current palette (ranging 0-1). background is a color index in current palette (ranging 0-1).;7, 8;foreground is a color index in current palette (ranging 0-15). background is screen color index in current palette (ranging 0-15).;9;foreground is a color index in current palette (ranging 0-63). background is screen color index in current palette (ranging 0-63).;12;foreground is a color index in current palette (ranging 0-15). background is a color index in current palette (ranging 0-15).;13 and up;foreground is a color index in current palette (ranging 0-255). background is a color index in current palette (ranging 0-255)."}}


Revision [15742]

Edited on 2012-01-20 11:49:16 by CountingPine [Formatting]
Additions:
If you are using a color depth higher than 8bpp, foreground and background are direct ##[[KeyPgRgb RGB]]## color values in the form ##&h//AARRGGBB//##, where ##//AA//##, ##//RR//##, ##//GG//## and ##//BB//## are the alpha, red, green and blue components ranging ##&h00##-##&hFF## (##0##-##255## in decimal notation). While in hi/truecolor modes, you can use the ##[[KeyPgRgb RGB]]## or ##[[KeyPgRgba RGBA]]## macro to obtain a valid color value.
Deletions:
If you are using a color depth higher than 8bpp, foreground and background are direct ##[[KeyPgRgb RGB]]## color values in the form ##&hAARRGGBB##, where ##AA##, ##RR##, ##GG## and ##BB## are the alpha, red, green and blue components ranging ##&h00-&hFF## (0-255 in decimal notation). While in hi/truecolor modes, you can use the ##[[KeyPgRgb RGB]]## or ##[[KeyPgRgba RGBA]]## macro to obtain a valid color value.


Revision [12006]

The oldest known version of this page was created on 2008-01-03 11:18:05 by JeffMarshall [Formatting]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode