1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-26 17:10:38 +00:00

Make $NOPREFIX-friendly versions of $COLOR includes (#206)

* Create `$NOPREFIX`-friendly version of `color0.bi`

* Create color32_noprefix.bi

* add conditional for noprefix $color

* oh. it was that easy?

* Update CHANGELOG.md

* Update help files [ci-skip]

Co-authored-by: all-other-usernames-were-taken <74026992+all-other-usernames-were-taken@users.noreply.github.com>
This commit is contained in:
Kit 2021-11-05 00:46:28 -04:00 committed by GitHub
parent f795828806
commit 72126a1289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 325 additions and 6 deletions

View file

@ -5,6 +5,7 @@
- Implement the `_Bin$` function as counterpart to `&B` prefixed number strings. Usage is analog to the legacy OCT$ and HEX$ functions.
- Add "Check For Newer Version" option in the Help menu.
- Save Watch Panel position and size.
- Add `$NOPREFIX` support for `$COLOR`
<!---
### Windows

View file

@ -10,7 +10,7 @@
* [[$COLOR]]:0 adds [[CONST|constants]] for colors 0-15. The actual constant names can be found in the file '''source/utilities/color0.bi'''.
* [[$COLOR]]:32 adds [[CONST|constants]] for 32-bit colors, similar to HTML color names. The actual constant names can be found in the file '''source/utilities/color32.bi'''.
* [[$COLOR]] is a shorthand to manually using [[$INCLUDE]] pointing to the files listed above.
* Not compatible with [[$NOPREFIX]].
* ''NOTE'': When using [[$NOPREFIX]], the color constants change to '''C_<old name>''' (ex: '''Blue''' becomes '''C_Blue''').
{{PageExamples}}
@ -18,7 +18,7 @@
{{CodeStart}}
{{Cl|$COLOR}}:0
{{Cl|COLOR}} BrightWhite, Red
{{Cl|PRINT}} "Bright white on red."
{{Cl|PRINT}} "BrightWhite on red."
{{CodeEnd}}
@ -31,9 +31,19 @@
{{CodeEnd}}
''Example 3:'' Using [[$COLOR]] with [[$NOPREFIX]]:
{{CodeStart}}
{{Cl|$NOPREFIX}}
{{Cl|$COLOR}}:0
{{Cl|COLOR}} C_BrightWhite, C_Red
{{Cl|PRINT}} "BrightWhite on Red."
{{CodeEnd}}
{{PageSeeAlso}}
* [[COLOR]], [[SCREEN]]
* [[_NEWIMAGE]], [[$INCLUDE]]
* [[$NOPREFIX]]
* [[Metacommand]]

View file

@ -0,0 +1,19 @@
'$COLOR:0
'Color constants for text mode, when using $NOPREFIX
CONST C_Black~%% = 0
CONST C_Blue~%% = 1
CONST C_Green~%% = 2
CONST C_Cyan~%% = 3
CONST C_Red~%% = 4
CONST C_Magenta~%% = 5
CONST C_Brown~%% = 6
CONST C_White~%% = 7
CONST C_Gray~%% = 8
CONST C_LightBlue~%% = 9
CONST C_LightGreen~%% = 10
CONST C_LightCyan~%% = 11
CONST C_LightRed~%% = 12
CONST C_LightMagenta~%% = 13
CONST C_Yellow~%% = 14
CONST C_BrightWhite~%% = 15
CONST C_Blink~%% = 16

View file

@ -0,0 +1,272 @@
'$COLOR:32
'Color constants for 32bit mode, based on HTML color names, when using $NOPREFIX
CONST C_AliceBlue~& = 4293982463
CONST C_Almond~& = 4293910221
CONST C_AntiqueBrass~& = 4291663221
CONST C_AntiqueWhite~& = 4294634455
CONST C_Apricot~& = 4294826421
CONST C_Aqua~& = 4278255615
CONST C_Aquamarine~& = 4286578644
CONST C_Asparagus~& = 4287080811
CONST C_AtomicTangerine~& = 4294943860
CONST C_Azure~& = 4293984255
CONST C_BananaMania~& = 4294633397
CONST C_Beaver~& = 4288643440
CONST C_Beige~& = 4294309340
CONST C_Bisque~& = 4294960324
CONST C_Bittersweet~& = 4294802542
CONST C_Black~& = 4278190080
CONST C_BlanchedAlmond~& = 4294962125
CONST C_BlizzardBlue~& = 4289521134
CONST C_Blue~& = 4278190335
CONST C_BlueBell~& = 4288848592
CONST C_BlueGray~& = 4284914124
CONST C_BlueGreen~& = 4279081146
CONST C_BlueViolet~& = 4287245282
CONST C_Blush~& = 4292763011
CONST C_BrickRed~& = 4291510612
CONST C_Brown~& = 4289014314
CONST C_BurlyWood~& = 4292786311
CONST C_BurntOrange~& = 4294934345
CONST C_BurntSienna~& = 4293557853
CONST C_CadetBlue~& = 4284456608
CONST C_Canary~& = 4294967193
CONST C_CaribbeanGreen~& = 4280079266
CONST C_CarnationPink~& = 4294945484
CONST C_Cerise~& = 4292691090
CONST C_Cerulean~& = 4280134870
CONST C_ChartReuse~& = 4286578432
CONST C_Chestnut~& = 4290534744
CONST C_Chocolate~& = 4291979550
CONST C_Copper~& = 4292711541
CONST C_Coral~& = 4294934352
CONST C_Cornflower~& = 4288335595
CONST C_CornflowerBlue~& = 4284782061
CONST C_Cornsilk~& = 4294965468
CONST C_CottonCandy~& = 4294950105
CONST C_CrayolaAquamarine~& = 4286110690
CONST C_CrayolaBlue~& = 4280251902
CONST C_CrayolaBlueViolet~& = 4285753021
CONST C_CrayolaBrown~& = 4290013005
CONST C_CrayolaCadetBlue~& = 4289771462
CONST C_CrayolaForestGreen~& = 4285378177
CONST C_CrayolaGold~& = 4293379735
CONST C_CrayolaGoldenrod~& = 4294760821
CONST C_CrayolaGray~& = 4287992204
CONST C_CrayolaGreen~& = 4280069240
CONST C_CrayolaGreenYellow~& = 4293978257
CONST C_CrayolaIndigo~& = 4284315339
CONST C_CrayolaLavender~& = 4294751445
CONST C_CrayolaMagenta~& = 4294337711
CONST C_CrayolaMaroon~& = 4291311706
CONST C_CrayolaMidnightBlue~& = 4279912566
CONST C_CrayolaOrange~& = 4294931768
CONST C_CrayolaOrangeRed~& = 4294912811
CONST C_CrayolaOrchid~& = 4293306583
CONST C_CrayolaPlum~& = 4287513989
CONST C_CrayolaRed~& = 4293795917
CONST C_CrayolaSalmon~& = 4294941610
CONST C_CrayolaSeaGreen~& = 4288668351
CONST C_CrayolaSilver~& = 4291675586
CONST C_CrayolaSkyBlue~& = 4286634731
CONST C_CrayolaSpringGreen~& = 4293716670
CONST C_CrayolaTann~& = 4294616940
CONST C_CrayolaThistle~& = 4293642207
CONST C_CrayolaViolet~& = 4287786670
CONST C_CrayolaYellow~& = 4294764675
CONST C_CrayolaYellowGreen~& = 4291158916
CONST C_Crimson~& = 4292613180
CONST C_Cyan~& = 4278255615
CONST C_Dandelion~& = 4294826861
CONST C_DarkBlue~& = 4278190219
CONST C_DarkCyan~& = 4278225803
CONST C_DarkGoldenRod~& = 4290283019
CONST C_DarkGray~& = 4289309097
CONST C_DarkGreen~& = 4278215680
CONST C_DarkKhaki~& = 4290623339
CONST C_DarkMagenta~& = 4287299723
CONST C_DarkOliveGreen~& = 4283788079
CONST C_DarkOrange~& = 4294937600
CONST C_DarkOrchid~& = 4288230092
CONST C_DarkRed~& = 4287299584
CONST C_DarkSalmon~& = 4293498490
CONST C_DarkSeaGreen~& = 4287609999
CONST C_DarkSlateBlue~& = 4282924427
CONST C_DarkSlateGray~& = 4281290575
CONST C_DarkTurquoise~& = 4278243025
CONST C_DarkViolet~& = 4287889619
CONST C_DeepPink~& = 4294907027
CONST C_DeepSkyBlue~& = 4278239231
CONST C_Denim~& = 4281035972
CONST C_DesertSand~& = 4293905848
CONST C_DimGray~& = 4285098345
CONST C_DodgerBlue~& = 4280193279
CONST C_Eggplant~& = 4285419872
CONST C_ElectricLime~& = 4291755805
CONST C_Fern~& = 4285643896
CONST C_FireBrick~& = 4289864226
CONST C_Floralwhite~& = 4294966000
CONST C_ForestGreen~& = 4280453922
CONST C_Fuchsia~& = 4290995397
CONST C_FuzzyWuzzy~& = 4291585638
CONST C_Gainsboro~& = 4292664540
CONST C_GhostWhite~& = 4294506751
CONST C_Gold~& = 4294956800
CONST C_GoldenRod~& = 4292519200
CONST C_GrannySmithApple~& = 4289258656
CONST C_Gray~& = 4286611584
CONST C_Green~& = 4278222848
CONST C_GreenBlue~& = 4279329972
CONST C_GreenYellow~& = 4289593135
CONST C_HoneyDew~& = 4293984240
CONST C_HotMagenta~& = 4294909390
CONST C_HotPink~& = 4294928820
CONST C_Inchworm~& = 4289915997
CONST C_IndianRed~& = 4291648604
CONST C_Indigo~& = 4283105410
CONST C_Ivory~& = 4294967280
CONST C_JazzberryJam~& = 4291442535
CONST C_JungleGreen~& = 4282101903
CONST C_Khaki~& = 4293977740
CONST C_LaserLemon~& = 4294901282
CONST C_Lavender~& = 4293322490
CONST C_LavenderBlush~& = 4294963445
CONST C_LawnGreen~& = 4286381056
CONST C_LemonChiffon~& = 4294965965
CONST C_LemonYellow~& = 4294964303
CONST C_LightBlue~& = 4289583334
CONST C_LightCoral~& = 4293951616
CONST C_LightCyan~& = 4292935679
CONST C_LightGoldenRodYellow~& = 4294638290
CONST C_LightGray~& = 4292072403
CONST C_LightGreen~& = 4287688336
CONST C_LightPink~& = 4294948545
CONST C_LightSalmon~& = 4294942842
CONST C_LightSeaGreen~& = 4280332970
CONST C_LightSkyBlue~& = 4287090426
CONST C_LightSlateGray~& = 4286023833
CONST C_LightSteelBlue~& = 4289774814
CONST C_LightYellow~& = 4294967264
CONST C_Lime~& = 4278255360
CONST C_LimeGreen~& = 4281519410
CONST C_Linen~& = 4294635750
CONST C_MacaroniAndCheese~& = 4294950280
CONST C_Magenta~& = 4294902015
CONST C_MagicMint~& = 4289392849
CONST C_Mahogany~& = 4291643980
CONST C_Maize~& = 4293775772
CONST C_Manatee~& = 4288125610
CONST C_MangoTango~& = 4294935107
CONST C_Maroon~& = 4286578688
CONST C_Mauvelous~& = 4293892266
CONST C_MediumAquamarine~& = 4284927402
CONST C_MediumBlue~& = 4278190285
CONST C_MediumOrchid~& = 4290401747
CONST C_MediumPurple~& = 4287852763
CONST C_MediumSeaGreen~& = 4282168177
CONST C_MediumSlateBlue~& = 4286277870
CONST C_MediumSpringGreen~& = 4278254234
CONST C_MediumTurquoise~& = 4282962380
CONST C_MediumVioletRed~& = 4291237253
CONST C_Melon~& = 4294818996
CONST C_MidnightBlue~& = 4279834992
CONST C_MintCream~& = 4294311930
CONST C_MistyRose~& = 4294960353
CONST C_Moccasin~& = 4294960309
CONST C_MountainMeadow~& = 4281383567
CONST C_Mulberry~& = 4291120012
CONST C_NavajoWhite~& = 4294958765
CONST C_Navy~& = 4278190208
CONST C_NavyBlue~& = 4279858386
CONST C_NeonCarrot~& = 4294943555
CONST C_OldLace~& = 4294833638
CONST C_Olive~& = 4286611456
CONST C_OliveDrab~& = 4285238819
CONST C_OliveGreen~& = 4290426988
CONST C_Orange~& = 4294944000
CONST C_OrangeRed~& = 4294919424
CONST C_OrangeYellow~& = 4294497640
CONST C_Orchid~& = 4292505814
CONST C_OuterSpace~& = 4282468940
CONST C_OutrageousOrange~& = 4294929994
CONST C_PacificBlue~& = 4280068553
CONST C_PaleGoldenRod~& = 4293847210
CONST C_PaleGreen~& = 4288215960
CONST C_PaleTurquoise~& = 4289720046
CONST C_PaleVioletRed~& = 4292571283
CONST C_PapayaWhip~& = 4294963157
CONST C_Peach~& = 4294954923
CONST C_PeachPuff~& = 4294957753
CONST C_Periwinkle~& = 4291154150
CONST C_Peru~& = 4291659071
CONST C_PiggyPink~& = 4294827494
CONST C_PineGreen~& = 4279599224
CONST C_Pink~& = 4294951115
CONST C_PinkFlamingo~& = 4294735101
CONST C_PinkSherbet~& = 4294414247
CONST C_Plum~& = 4292714717
CONST C_PowderBlue~& = 4289781990
CONST C_Purple~& = 4286578816
CONST C_PurpleHeart~& = 4285809352
CONST C_PurpleMountainsMajesty~& = 4288512442
CONST C_PurplePizzazz~& = 4294856410
CONST C_RadicalRed~& = 4294920556
CONST C_RawSienna~& = 4292250201
CONST C_RawUmber~& = 4285614883
CONST C_RazzleDazzleRose~& = 4294920400
CONST C_Razzmatazz~& = 4293076331
CONST C_Red~& = 4294901760
CONST C_RedOrange~& = 4294923081
CONST C_RedViolet~& = 4290790543
CONST C_RobinsEggBlue~& = 4280274635
CONST C_RosyBrown~& = 4290547599
CONST C_RoyalBlue~& = 4282477025
CONST C_RoyalPurple~& = 4286075305
CONST C_SaddleBrown~& = 4287317267
CONST C_Salmon~& = 4294606962
CONST C_SandyBrown~& = 4294222944
CONST C_Scarlet~& = 4294715463
CONST C_ScreaminGreen~& = 4285988730
CONST C_SeaGreen~& = 4281240407
CONST C_SeaShell~& = 4294964718
CONST C_Sepia~& = 4289030479
CONST C_Shadow~& = 4287265117
CONST C_Shamrock~& = 4282764962
CONST C_ShockingPink~& = 4294672125
CONST C_Sienna~& = 4288696877
CONST C_Silver~& = 4290822336
CONST C_SkyBlue~& = 4287090411
CONST C_SlateBlue~& = 4285160141
CONST C_SlateGray~& = 4285563024
CONST C_Snow~& = 4294966010
CONST C_SpringGreen~& = 4278255487
CONST C_SteelBlue~& = 4282811060
CONST C_Sunglow~& = 4294954824
CONST C_SunsetOrange~& = 4294794835
CONST C_Tann~& = 4291998860
CONST C_Teal~& = 4278222976
CONST C_TealBlue~& = 4279805877
CONST C_Thistle~& = 4292394968
CONST C_TickleMePink~& = 4294740396
CONST C_Timberwolf~& = 4292597714
CONST C_Tomato~& = 4294927175
CONST C_TropicalRainForest~& = 4279730285
CONST C_Tumbleweed~& = 4292782728
CONST C_Turquoise~& = 4282441936
CONST C_TurquoiseBlue~& = 4286045671
CONST C_UnmellowYellow~& = 4294967142
CONST C_Violet~& = 4293821166
CONST C_VioletBlue~& = 4281486002
CONST C_VioletRed~& = 4294398868
CONST C_VividTangerine~& = 4294942857
CONST C_VividViolet~& = 4287582365
CONST C_Wheat~& = 4294303411
CONST C_White~& = 4294967295
CONST C_Whitesmoke~& = 4294309365
CONST C_WildBlueYonder~& = 4288851408
CONST C_WildStrawberry~& = 4294919076
CONST C_WildWatermelon~& = 4294732933
CONST C_Wisteria~& = 4291667166
CONST C_Yellow~& = 4294967040
CONST C_YellowGreen~& = 4288335154
CONST C_YellowOrange~& = 4294946370

View file

@ -1710,12 +1710,20 @@ DO
temp$ = LTRIM$(RTRIM$(UCASE$(wholestv$)))
IF temp$ = "$COLOR:0" THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0.bi"
IF qb64prefix_set THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0_noprefix.bi"
ELSE
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0.bi"
END IF
GOTO finishedlinepp
END IF
IF temp$ = "$COLOR:32" THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32.bi"
IF qb64prefix_set THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32_noprefix.bi"
ELSE
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32.bi"
END IF
GOTO finishedlinepp
END IF
@ -3110,14 +3118,22 @@ DO
IF a3u$ = "$COLOR:0" THEN
layout$ = SCase$("$Color:0")
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0.bi"
IF qb64prefix_set THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0_noprefix.bi"
ELSE
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color0.bi"
END IF
layoutdone = 1
GOTO finishednonexec
END IF
IF a3u$ = "$COLOR:32" THEN
layout$ = SCase$("$Color:32")
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32.bi"
IF qb64prefix_set THEN
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32_noprefix.bi"
ELSE
addmetainclude$ = getfilepath$(COMMAND$(0)) + "internal" + pathsep$ + "support" + pathsep$ + "color" + pathsep$ + "color32.bi"
END IF
layoutdone = 1
GOTO finishednonexec
END IF
@ -26325,3 +26341,4 @@ DEFLNG A-Z
'-------- Optional IDE Component (2/2) --------
'$INCLUDE:'ide\ide_methods.bas'