QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: acjacques on October 28, 2019, 12:16:54 am
-
How change default foreground and background colors for text and graphics
with SCREEN _NEWIMAGE (800,600,32) ?
I have tried
COLOR 14, 0
and _PALETTECOLOR
but doesn't work. Just a black screen .
Works with
SCREEN 12
but not with _NEWIMAGE
-
The 32 in _NEWIMAGE(Width, Height, 32) means you are in the land of _RGB32(red, green, blue) colors.
Red, green, blue run from 0 to 255,
_RGB32(255, 0, 0) = color #12 in 0-15 color numbers, yellow _RGB32(255, 255, 0) see _RGB32() for more.
Another way to command colors in 32 bit color mode is Hexidecimal &H FF FF FF FF
the first 2 FF are alpha or transparency FF is fully opaque 0 is fully transparent
the next 2 FF are red levels
the next 2 FF are green levels
the next 2 FF are blue
_NEWIMAGE has many screen modes other than 32, you might like 12 with 256 colors (if read the help file correctly)
-
Thanks
now this works
COLOR (_RGB32(255, 255, 0)) 'yellow color foreground
and for background color ?
-
OK Thanks .
SOLVED
COLOR _RGB32(255, 255, 0), _RGB32(255, 0, 255) ' first term is color foreground , second is for background
-
:) good!