get_blend() negative v value

Pixilang programming language
Post Reply
User avatar
FreeFull
Posts: 41
Joined: Fri Dec 10, 2010 11:42 am

get_blend() negative v value

Post by FreeFull »

I just discovered feeding varying negative v values to get_blend can create really nice shimmering colours (if one of the colours passed to get_blend is the previous colour of a the pixel on the canvas that you are writing to).
For example:

Code: Select all

screen = get_screen()
SCRX = get_xsize(screen)
XSIZE = 256
YSIZE = XSIZE
TSIZE = XSIZE
OFFSET = (SCRX-XSIZE)/2

x = 0
y = 0
t = 0

while( 1 ) {
	while( x<XSIZE ) {
		while( y<YSIZE ) {
			if(x^y)==t {
				screen[ y+(x*SCRX)+OFFSET ] = WHITE
			}
			else {
				screen[ y+(x*SCRX)+OFFSET ] = get_blend(screen[ y+(x*SCRX)+OFFSET ], BLACK, (-y))
			}
			y = y + 1
		}
		y = 0
		x = x + 1
	}
	x = 0
	t = (t + 1) & (TSIZE-1)
	frame()
}
Post Reply