mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-16 03:54:01 +00:00
b586eafd3b
LINE INPUT will now use the faster method if passed a file handle that has been opened FOR BINARY. As such, the _BLINEINPUT command has been removed. qb64.bas now takes advantage of this for reading from '$include files, at least in Include Manager 1. Some tweaking of internal/source/main.txt was required to get things into a sane state, so I'm holing off changing the compiler any further so the auto-builder can make sure everything's smoothed over. Note: Everything should still compile as normal; I'm just being overcautious.
42 lines
No EOL
1.7 KiB
Text
42 lines
No EOL
1.7 KiB
Text
The '''PALETTE''' statement can swap color settings, set colors to default or set the Red, Green, Blue color palette.
|
|
|
|
|
|
|
|
''RGB'' {{PageSyntax}}
|
|
|
|
:::PALETTE [''attribute'', ''Red'' + (''Green'' * 256) + (''Blue'' * 65536)]
|
|
|
|
''Swap'' {{PageSyntax}}
|
|
|
|
:::PALETTE [''set_attribute'', new_attribute]
|
|
|
|
|
|
* ''Red'', ''Green'' and ''Blue'' values can be from 0 to 63. Many color shades possible in non-[[DAC]] color attributes.
|
|
* If the Red, Green and Blue color intensity settings are all the same value the color is greyscale.
|
|
* Screens 0, 7 and 9 ([[DAC]]) colors cannot be changed by the RGB syntax statement in QBasic! Can use [[OUT]] to change attribute 1 thru 5 intensity settings.
|
|
* A swap is often used with [[DAC]] color attributes that cannot change RGB settings. Only the RGB color settings are swapped from original ''set_attribute'' to ''new_attribute''. Screens 0 thru 9 support swaps. Screen 10 up to 8 only.
|
|
* PALETTE without any value sets any changed RGB settings back to the Qbasic default color settings including [[DAC]] colors.
|
|
* [[PALETTE USING]] can be used when color intensity values are stored in an [[Arrays|array]].
|
|
|
|
|
|
''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 = 1 {{Cl|TO}} 64
|
|
a$ = {{Cl|INPUT$}}(1) ' wait for a keypress
|
|
{{Cl|PALETTE}} 0, i
|
|
{{Cl|NEXT}} '' ''
|
|
{{CodeEnd}}
|
|
:''Note:'' Other attributes(1 to 15) can be swapped for DAC foreground colors also.
|
|
|
|
|
|
''See also:''
|
|
* [[PALETTE USING]]
|
|
* [[COLOR]]
|
|
* [[OUT]], [[INP]]
|
|
* [[SCREEN]]
|
|
|
|
|
|
{{PageNavigation}} |