Using color in Draw string - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Using color in Draw string (/showthread.php?tid=2573) |
Using color in Draw string - PhilOfPerth - 04-04-2024 How do I (or can I) nominate a colour for the string in this code? Code: (Select All) WWidth = 1120: WHeight = 820: Mode = 32: Size = 24 I've tried adding C3 etc to the front, which is accepted but ignored, and C_rgb(...) which errors out. RE: Using color in Draw string - SMcNeill - 04-04-2024 You're in 32-bit screen mode; you have to use 32-bit color values as below: Code: (Select All)
RE: Using color in Draw string - PhilOfPerth - 04-04-2024 Ah, got it! You nailed it again. Thanks Steve! RE: Using color in Draw string - PhilOfPerth - 04-04-2024 I get how to place the colours in the string, but what I don't get is how the hex codes are interpreted. Which "digits" set which colour? &HFFFF0000& 'Red Seemed pretty obvious at first- full slab of red, and nothing else (but where are the third group of colour digits?) &HFF00FF00& 'Green Here I get even more confused: 255 portions of red, and ... ??? &HFF000000& 'blue RE: Using color in Draw string - SMcNeill - 04-04-2024 AARRGGBB, in hex. Alpha Red Green Blue. 2 hex values represented for 0 to 255 in each. RE: Using color in Draw string - PhilOfPerth - 04-04-2024 Completely forgot about Alpha! And I messed up your codes, sorry Ok, try again! RE: Using color in Draw string - Pete - 04-04-2024 Did someone say DRAW, varmints! Code: (Select All)
Errr better still... Code: (Select All)
Pete RE: Using color in Draw string - TerryRitchie - 04-04-2024 (04-04-2024, 09:19 AM)PhilOfPerth Wrote: Completely forgot about Alpha! The first sections in lesson 14 of the tutorial explains how the color codes work if you would like a refresher. https://www.qb64tutorial.com/lesson14 RE: Using color in Draw string - Dimster - 04-04-2024 Terry - I do find your tutorials very very helpful and your suggestion here to Phil sure does help me understand better exactly what the problem is that Phil is running into and the potential solution. The little annoying thing that I'm running into however is leaving my coding and accessing the digital version of reference material,(in which I place your tutorial) or doing a search on this forum for more insight. I'd much prefer (likely I'd be in the minority here) to have a hard copy manual/binder of reference material beside me to lookup stuff while I'm starring at my code. Wouldn't it be nice if you and Steve could get together a produce a hard copy of your tutorial and Steve's (almost completed) bible. Place that as one of the items we can buy on this forum site along with the coffee mugs. Just saying. RE: Using color in Draw string - Pete - 04-04-2024 Hell, you could place everything Steve knows about QB64 on the COFFEE MUG and still have room for a full size image of Yosemite Sam on the back! (He's really that short!) J/K Steve's response: Pete is absolutely right, you'd just have to print it in a .0001 pixel font. Pete |