;Convert: ----GGGG RRRRBBBB
; 	  To: -BBBBbGG GGgRRRRr

SetPalette:		;-GRB
	pha 
		sta $2121
		jsr WaitVblank
		lda #0
		sta z_C
		
		lda z_H			;----GGGG
		lsr
		ror z_C
		lsr
		ror z_C			;GGgrrrrr	
		and #%00000011
		sta z_B			;-bbbbbGG
		
		lda z_L			;RRRRbbbb
		lsr
		lsr
		lsr
		and #%00011110	;GGgRRRRr
		ora z_C
		sta z_C
		
		lda z_L			;rrrrBBBB
		asl
		asl
		asl
		and #%01111000	;-BBBBbgg
		ora z_B
		sta z_B
		
		jsr SetPaletteSendColors
	pla
	ora #%10000000			;Set equivalent Sprite palette 
	sta $2121
SetPaletteSendColors:
	lda z_C				;GGGRRRRR
	sta $2122
	lda z_B				;-BBBBBGG
	sta $2122
	rts 
	
	
	