Krion Posted May 2, 2019 Share Posted May 2, 2019 (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: 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 May 2, 2019 by that Abstract guy Quote Link to comment Share on other sites More sharing options...
flcc Posted May 2, 2019 Share Posted May 2, 2019 (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 May 2, 2019 by flcc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.