Jump to content
Krion

Ways to assign pre-defined colours?

Recommended Posts

Posted (edited)

Hi!

I am new to programming and VEX. I have here this little scene where I stored a custom color as a detail attribute:

ScreenFlow.thumb.gif.76aee6ec7e6495b1e2ba49fbd15c5e76.gif

I was wondering how I could color this with white and my 'customBlue'. So that the black would become my "customBlue".

Or maybe if there are more convenient ways to do this, I would like to know that too. :) 

 

Thanks for your help!

 

Code:

Detail Wrangle:

v@customBlue = {54,95,236};
@customBlue = fit(@customBlue, 0, 255, 0, 1);

Point Wrangle:

 float d = length(@P);
 d *= ch('scale');
 @Cd  = sin(d); 
//  @Cd = detailattrib(0, 'customBlue', 0, 0);

 

Edited by that Abstract guy

Share this post


Link to post
Share on other sites
Posted (edited)

You can try the fit function where the new min will be the color values.

vector customBlue = detailattrib(0, 'customBlue', 0, 0);
float grey = sin(d);
@Cd.r = fit(grey, 0, 1, customBlue.r, 1);
@Cd.g = fit(grey, 0, 1, customBlue.g, 1);
@Cd.b = fit(grey, 0, 1, customBlue.b, 1);
Edited by flcc
  • Thanks 1

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

×