appendPattern
Return
the number of elements added to target.
Parameters
target
encode black/white pattern into this array
pos
position to start encoding at in target
pattern
lengths of black/white runs to encode
startColor
starting color - false for white, true for black