QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: badger on September 26, 2020, 11:41:51 am

Title: $color statement
Post by: badger on September 26, 2020, 11:41:51 am
Hello

i was looking at this code sinipit
 
SCREEN _NEWIMAGE(640, 400, 32)
$COLOR:32
COLOR CrayolaGold, DarkCyan
PRINT "CrayolaGold on DarkCyan.
this works fine by itself. 

I use it on my program i get illegal function call when using the color crayolagold,darkcyan  i would like to know what i am doing wrong

Badger
Title: Re: $color statement
Post by: bplus on September 26, 2020, 11:51:25 am
What version QB64 are you using? I am using 1.4 stable and it works fine.
Title: Re: $color statement
Post by: badger on September 26, 2020, 11:57:36 am
Hello

it says 1.4 on the zip file i downloaded. I may be doing something else ware that conflicts with it

Badger

The code sinpit runs well by itself it is only in my code that is does this ..

Title: Re: $color statement
Post by: bplus on September 26, 2020, 12:00:17 pm
So are you in a 32 bit color Screen?

That is a line like this:
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(640, 400, 32)
Title: Re: $color statement
Post by: badger on September 26, 2020, 12:14:38 pm
Hello

Thanks for the advice no i was not using that thinking i could not use _fullscreen but you can got it working

Badger
Title: Re: $color statement
Post by: bplus on September 26, 2020, 12:17:23 pm
Yeah you can use full screen with that too.
Title: Re: $color statement
Post by: johnno56 on September 26, 2020, 06:00:10 pm
Cool... Have never used the $color command before... By the way, to be able to select the different colours, those colour names would have to be stored somewhere... nudge, nudge... lol
Title: Re: $color statement
Post by: SpriggsySpriggs on September 26, 2020, 06:02:52 pm
Quick tip: using the $COLOR command means you can't use the $NOPREFIX command as they are not compatible. Not many people use $NOPREFIX and I haven't been using it recently since I've been sharing so much code. On my own personal programs I do use the command.
Title: Re: $color statement
Post by: bplus on September 26, 2020, 06:24:21 pm
Cool... Have never used the $color command before... By the way, to be able to select the different colours, those colour names would have to be stored somewhere... nudge, nudge... lol

http://www.qb64.org/wiki/$COLOR
Quote
The actual constant names can be found in the file source/utilities/color32.bi.
Title: Re: $color statement
Post by: johnno56 on September 26, 2020, 06:25:18 pm
umm... Never mind... Found the colour names in color32.bi... Guess I should have looked before asking, huh?