Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using $color:32 colour names mid-program?
#1
Question 
hello!
so, i've been racking my brain all day for this and decided to ask the experts.
it's very easy to change color mid-program using various means, but what i wanted to know if there's a way to type in the $color:32 color name constants mid program and actually use them, e.g. someone typing in the colour they want?

nothing i tried was working—i could only input it in a variable as a string, but the string can't be translated into a handle or an integer thats equivalent to the colour and used for Color and Color won't accept strings and—ugh, i was a mess this afternoon

i'm not familiar with the complexities, but i know just enough to worry it might not be possible without having to create palettes or references or subs or something to translate the name as a roundabout, not actually using the constant.

anyway, please let me know if there's something glaring i'm missing (or if it's obviously impossible!)

-keri
Reply
#2
Color names are like constants not seen by an executing file just like _Pi would not be seen or any variable name UNLESS you set up a routine to translate a string name for color to an _RGB32() value or an &H... value. Easy enough to do for a user to input a color they want to use.

There are also examples floating around about Color Pickers for users to select colors from, I think even bplus did one or 2 Smile
https://qb64phoenix.com/forum/showthread...68#pid1368

Steve has TSR: https://qb64phoenix.com/forum/showthread...0#pid31620

Dav has also posted on the subject: https://qb64phoenix.com/forum/showthread...lor+picker
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#3
thank you for confirming and sharing resources!!  Sleepy

-keri
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Don't fall for the mid$ trap doppler 10 1,390 10-19-2025, 08:21 PM
Last Post: Pete
  _CLEARCOLOR evety color EXCEPT ...? madscijr 4 824 04-27-2025, 10:51 PM
Last Post: TempodiBasic
  Need help capturng unicoded directory names doppler 25 3,705 12-19-2024, 12:33 PM
Last Post: SpriggsySpriggs
  Detecting color depth-16 color, 256 color, or 32 bit color dano 20 3,700 08-17-2024, 03:08 AM
Last Post: TerryRitchie
  Identifying colour attributes with negative numbers CharlieJV 1 572 01-28-2023, 05:16 AM
Last Post: CharlieJV

Forum Jump:


Users browsing this thread: