08-22-2023, 10:34 PM
Arg! I was in hockey puck mode and forgot to "rgb" the color for the PSET statement in the sub.
This works:
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