please include function randomLineWithColor. static void varyLineWithColor(LineWithColor l, int w, int h) { int i = random(randomLineWithColor_minLineWidth < randomLineWithColor_maxLineWidth ? 4 : 3); if (i == 0) l.a = varyPoint(l.a, w, h); else if (i == 1) l.b = varyPoint(l.b, w, h); else if (i == 2) l.color = varyColor(l.color); else { l.width = varyIntInRange(l.width, randomLineWithColor_minLineWidth, randomLineWithColor_maxLineWidth); limitLineThickness(l, randomLineWithColor_maxThickness, randomLineWithColor_minLineWidth); } }