[Implemented] Function RGBA() and Alpha()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
thyphoon
Enthusiast
Enthusiast
Posts: 345
Joined: Sat Dec 25, 2004 2:37 pm

[Implemented] Function RGBA() and Alpha()

Post by thyphoon »

Hello,

I see lot off topic about alpha, but no ask why don't add this function
to works with 32bit image
Color = RGBA(Red, Green, Blue, Alpha)
Result= Alpha(Color)

support for 32bit image with Color= Point(x, y) and Plot(x, y,color)

Best regards and excuse me for my bad english

Thy
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

The alpha could be tagged onto the end of the existing function - 0 being default?

eg

Code: Select all

x=RGB(r,g,b[,a])
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

DoubleDutch wrote:The alpha could be tagged onto the end of the existing function - 0 being default?

eg

Code: Select all

x=RGB(r,g,b[,a])
Well, 255 as default sound better :)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I thought that 0 was "not transparent"?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

Just as 0,0,0 means no colour, 255,255,255 means all colours :)

Think of it like a percentage, except it ranges upto 255 rather than 100.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

ahh, I thought that zero was a special case for compatibility?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

0 means it's transparent, and 255 means it's opaque :)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

ic, so for existing PureBasic compatibility it should default to 0, but ideally it should be 255 (RGB($ff,$ff,$ff) currently generates $00ffffff, not $ffffffff).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply