1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00
QB64-PE/internal/help/PALETTE_1111111.txt
Roland Heyder aeb9c0668b Updates help files for use with new Wiki parser (2nd try)
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
2022-05-21 00:18:31 +02:00

49 lines
2.1 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:15:29}}
The [[PALETTE]] statement can swap color settings, set colors to default or set the red, green and blue color components of palette colors.
{{PageSyntax}}
: [[PALETTE]] [{{Parameter|attribute%}}, ''red%'' + (''green%'' * 256) + (''blue%'' * 65536)]
: [[PALETTE]] [{{Parameter|existingAttribute%}}, {{Parameter|newAttribute%}}]
{{PageDescription}}
* {{Parameter|red%}}, {{Parameter|green%}} and {{Parameter|blue%}} values can range from 0 to 63. Many color shades are possible in non-[[DAC]] color attributes.
* If the {{Parameter|red%}}, {{Parameter|green%}} and {{Parameter|blue%}} color intensity settings are all the same value the resulting color is a shade of grey.
* A swap is often used with [[DAC]] color attributes that cannot change RGB settings. Only the RGB color settings are swapped from original {{Parameter|existingAttribute%}} to {{Parameter|newAttribute%}}. Screens 0 thru 9 support swaps. Screen 10 supports up to attribute 8 only.
* PALETTE without any value sets any changed RGB settings back to the default color settings, including [[DAC]] colors.
* [[PALETTE USING]] can be used when color intensity values are stored in an [[Arrays|array]].
* QB64 implements the [[_PALETTECOLOR]] statement to provide extended palette functionality.
==QBasic/QuickBASIC==
* Screens 0, 7 and 9 ([[DAC]]) colors could not be changed using the first syntax, but the program could use [[OUT]] to change intensity settings of attributes 1 thru 5.
{{PageExamples}}
''Example:'' Displaying all 64 DAC color hues as backgrounds in SCREEN 9 using a PALETTE swap.
{{CodeStart}}
{{Cl|SCREEN (statement)|SCREEN}} 9 ' background is default black
{{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Press any Key!"
{{Cl|FOR...NEXT|FOR}} i = 0 {{Cl|TO}} 63
a$ = {{Cl|INPUT$}}(1) ' wait for a keypress
{{Cl|PALETTE}} 0, i
{{Cl|NEXT}}
{{CodeEnd}}
:''Note:'' Other attributes (1 to 15) can also be swapped for DAC foreground colors.
{{PageSeeAlso}}
* [[_PALETTECOLOR]]
* [[PALETTE USING]]
* [[COLOR]]
* [[OUT]], [[INP]]
* [[SCREEN]]
{{PageNavigation}}