Author Topic: $color statement  (Read 4604 times)

0 Members and 1 Guest are viewing this topic.

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
$color statement
« 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

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: $color statement
« Reply #1 on: September 26, 2020, 11:51:25 am »
What version QB64 are you using? I am using 1.4 stable and it works fine.

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
Re: $color statement
« Reply #2 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 ..


Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: $color statement
« Reply #3 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)

Offline badger

  • Forum Regular
  • Posts: 148
    • View Profile
Re: $color statement
« Reply #4 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

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: $color statement
« Reply #5 on: September 26, 2020, 12:17:23 pm »
Yeah you can use full screen with that too.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: $color statement
« Reply #6 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
Logic is the beginning of wisdom.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: $color statement
« Reply #7 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.
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: $color statement
« Reply #8 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.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: $color statement
« Reply #9 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?
Logic is the beginning of wisdom.