Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Would this "RbgaPset" be a way around not having _RGBA ?
#3
Arg!  I was in hockey puck mode and forgot to "rgb" the color for the PSET statement in the sub.

This works:

Code: (Select All)
' This only works with BAM modes 23 to 27
' Not meant to be used with any other modes

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), _rgb( [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,255,255,0,255)
    next this_y
next this_x
Reply


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



Users browsing this thread: 1 Guest(s)