For basic vertical or horizontal stripes, you can simply loop through the UV coordinates and apply a step function based on the desired stripe width.
float stripeWidth = 0.1; // Adjust for desired stripe width
float value = step(stripeWidth, fract(uv.x / stripeWidth));
output.color = value * color1 + (1 - value) * color2;
If you want to create a more complex striped pattern, such as diagonal stripes or stripes at a specific angle, you can use the following approach:
float angle = radians(45);
float ratio = 0.3; // color1 takes up 30% of the stripe width, color 2 - the rest
float2 dir = { cos(angle), sin(angle) };
float value = step(ratio, fract(dot(uv, dir)));
output.color = value * color1 + (1 - value) * color2;