Day 001: _GREEN32
#1
Perhaps not the greatest of keywords to start with, but that's the nature of randomness.  It is what it is, so with no further ado, here's _GREEN32 explained and showcased.

What is _GREEN32?  It's a simple command that takes a color value and returns the green component back to you from it.

When would you use it?  Basically when you have a color (perhaps taken from one of the color names), and you need to know what the green value is in it.

Example:

Code: (Select All)
Screen _NewImage(640, 480, 32)
$Color:32

Print "Lime : "; Hex$(Lime)
Print "======"
Print "Alpha: "; Hex$(_Alpha32(Lime)), _Alpha32(Lime)
Print "Red  : "; Hex$(_Red32(Lime)), _Red32(Lime)
Print "Green: "; Hex$(_Green32(Lime)), _Green32(Lime)
Print "Blue : "; Hex$(_Blue32(Lime)), _Blue32(Lime)


As you can see from the simple example above, _GREEN32 can be used to easily get back the green color values from whatever 32-bit color you send to it.  Used in conjection with _ALPHA32, _RED32, and _BLUE32, you can quickly and easily break down a complex color value into its component parts with almost no effort on your part.  Smile
Reply


Messages In This Thread
Day 001: _GREEN32 - by SMcNeill - 11-06-2022, 02:33 PM
RE: Day 001: _GREEN32 - by Pete - 11-06-2022, 06:52 PM
RE: Day 001: _GREEN32 - by PhilOfPerth - 11-07-2022, 12:33 AM
RE: Day 001: _GREEN32 - by bplus - 11-07-2022, 07:23 PM



Users browsing this thread: 4 Guest(s)