Random Stripe Generator (Weighted)

I wrote this script to generate random stripe patterns for sweaters, scarves, blankets, etc. It'll give you an idea of what the finished object will look like, but it still leaves some unpredictability to the stripe pattern. This version of the Random Stripe Generator is useful if you have a limited amount of certain colors and want to weight the results to use more of one color than another. Try it out by entering your colors and their relative weights below.

Soft Waves Afghan

If you'd like to control stripe width, try the original Random Stripe Generator.


1. Select your yarn colors (minimum of 2) by entering their relative weights in the corresponding text fields, using a value of 1 for the color you want to occur least often.

Example: If you have 25 grams of blue yarn and 50 grams of red, divide both numbers by the smallest value (25 grams) to get the relative weights (1 for blue and 2 for red). Enter 1 in the box outlined in blue, and enter 2 in the box outlined in red. The resulting stripe sequence will have approximately twice as many red rows as blue rows.

       

2. How many rows total would you like generated (max. 1000)?