excel - Creating colors with loop -
i create maximum of twelve different colors looping incrementing color values. problem getting shades of same color or bright or dark. using interior.color = xxxxxxx
.
any idea how achieve nice colors?
this'll make nice rainbow :)
sub colors() application.screenupdating = false r = 1 c = 1 rv = 50 until rv >= 255 gv = 50 r = 1 until gv >= 255 bv = 50 c = 1 until bv >= 255 cells(r, cc + c).interior.color = rgb(rv, gv, bv) 'print nnumbers color 'cells(r, cc + c).value = rv & ", " & gv & ", " & bv bv = bv + 20 c = c + 1 loop gv = gv + 20 r = r + 1 loop rv = rv + 20 cc = cc + 1 loop until rv <= 0 gv = 50 r = 1 until gv >= 255 bv = 50 c = 1 until bv >= 255 cells(r, cc + c).interior.color = rgb(rv, gv, bv) 'print nnumbers color 'cells(r, cc + c).value = rv & ", " & gv & ", " & bv bv = bv + 20 c = c + 1 loop gv = gv + 20 r = r + 1 loop rv = rv - 20 cc = cc + 1 loop end sub
disclaimer: doesn't produce full color wheel, gets portion of spectrum. instance, it's missing color pink.
Comments
Post a Comment