View Single Post
Old 08-13-2016, 07:25 PM   #8
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
Default

When working with these gradients,I find it is best to actually ignore the r/g/b parameters and just manipulate the alpha. This works best if drawing on a black background (or maybe grey or white).

In working with the alpha, you are able to use negative values to good effect.

Here I am drawing a red rectangle on the black background. Note that the alpha for drawing the rectangle is itself .5 - that's just because the pure red color is a bit much. Toning it down lets you see the effect of hitting in the higher and lower numbers for the adjustment alpha.

Code:
desc:gradient

slider1:.5<-10,10,.001>a


@gfx

dady=slider1/gfx_h;

gfx_gradrect(0,0,gfx_w,gfx_h, .8,gfx_g,gfx_b,.5, 0,0,0,0,0,0,0, dady);
James HE is offline   Reply With Quote