New to pattern editing, would like help with “edgeburst” pattern

I am very new to the PixelBlaze, and I have some programming experience, but really zero experience with graphics or math generated graphics. What I am trying to do is take the “edgeburst” pattern just as it is, but I would like 1/2 of the strand to be one color and the other half to be a different color. I understand it is using a triangle (saw tooth) to mirror the sides and have them go out and come back, I am just wondering if there is a way to have the mirrored side be a different color? I already modified the hsv to hsv(.33,1,v) to make it a solid green, but it is all green. And would like the mirrored side to be blue (like hsv(.6,1,v)) I hope this makes sense, and that there is an easy solution! Thanks!!

If you’ve still got the f = index/pixelCount line near the top of render in your version of Edgeburst, you can make 1/2 green and the other half blue just by doing this:

hsv((f < 0.5) ? 0.3 : 0.6, s, v);

How it works:
f is the position of the current pixel in the strip, scaled from 0 to 1 (basically 0 to 100%). The ternary operator ?, if you’re not already familiar with it from other languages, is just a shortcut version of:

if (f < 0.5) {
   hue = 0.3;
} else { 
  hue = 0.6;
}
hsv(hue, s,v);
2 Likes

You are awesome!!! I probably typed the shortcut version wrong because for some reason it stayed green, so I typed in the full if statement instead, and it worked perfectly!!!

Thank you very much for you help, it is very much appreciated!!!

2 Likes