Jump to content
Sign in to follow this  

Best way to get color from multilist in vex?

Recommended Posts

Hello Community, I am stuck on a problem to get colors from multi-list parameter. I am trying to implement picking a color from a multi-list parameter randomly and I wrote this vex below.

int seed = int(rand(@ptnum) * chf("colors"));

v@Cd = chv(sprintf("./color%dr",seed+1));

For some reason, it gives me black or white only... And I couldn't figure out why is this happening. Could someone advise me about this? Thank you in advance!


Share this post

Link to post
Share on other sites

Figured out and it was very dumb... I had extra "r" after %d in sprintf function... Thank you all

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this