Predefined color constants with alpha "255"

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 559
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Predefined color constants with alpha "255"

Post by Sicro »

Since the last release of PB we have now predefined color constants on linux, too.

Now, it would be good we have color constants with alpha channel, too.

Code: Select all

#Blue_Alpha  = -65536    ;RGBA(0, 0, 255, 255)
#Black_Alpha = -16777216 ;RGBA(0, 0, 0, 255)
; and so on
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Predefined color constants with alpha "255"

Post by skywalk »

+1
Very helpful since the Vector Drawing Lib requires RGBA() colors.
I prefer to prefix my color constants with 'a'.

Code: Select all

;- BLUE
#aBlue          = $FFFF0000   ; RGBA(0, 0, 255, 255)
#aBlueLightSky  = $FFFF0000   ; RGBA(135, 206, 250, 255)
#BlueDark       = $800000     ; RGB(0, 0, 128)
#aBlueDark      = $FF800000   ; RGBA(0, 0, 128, 255)
;- BROWN
#Brown          = $2A2AA5     ; RGB(165, 42, 42)
#aBrown         = $FF2A2AA5   ; RGBA(165, 42, 42, 255)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Predefined color constants with alpha "255"

Post by nco2k »

if they would add a simple #Alpha = -16777216 constant, then we could use it like this:

Color.l = #Blue | #Alpha

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Predefined color constants with alpha "255"

Post by Little John »

Sicro wrote:Now, it would be good we have color constants with alpha channel, too.
+1

In general, it would be good if PB had consistent alpha channel support, not only for predefined constants.
Post Reply