Jump to content

Ways to assign pre-defined colours?


Recommended Posts


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


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!



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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...