Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Would this "RbgaPset" be a way around not having _RGBA ?
#1
Implementing _RGBA in BAM would be, I think, I real nightmare.

Instead, I'm thinking better to set an include library with this "RgbaPset" function.  Question is: am I right in thinking this yields the same as what _RGBA  would do color-wise ?

Code: (Select All)
SUB RgbaPset(x,y,r,g,b,a)
    c = POINT(x,y)
    c$ = RIGHT$("000000" + HEX$(c), 6)
    cr = VAL("0x" + LEFT$(c$,2)) * 256 ^ 2
    cg = VAL("0x" + MID$(c$,3,2)) * 256 ^ 1
    cb = VAL("0x" + RIGHT$(c$,2))
    PSET(x,y), { [cr * (255-a)/255 + r * a / 255] _
                + [cg * (255-a)/255 + g * a / 255] _
                + [cb * (255-a)/255 + b * a / 255] }
END SUB

screen 27

line (0,0) - (400,400), &h0000ff ,BF

FOR this_x = 50 to 150
FOR this_y = 50 to 150

RgbaPset(this_x,this_y,0,0,0,100)

next this_y
next this_x
Reply


Messages In This Thread
Would this "RbgaPset" be a way around not having _RGBA ? - by CharlieJV - 08-22-2023, 06:16 PM



Users browsing this thread: 1 Guest(s)