<span class="n">segms</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">segms</span><span class="p">)</span> <span class="o">&gt;</span> <span class="n">i</span><span class="p">:</span>
            <span class="n">color_mask</span> <span class="o">=</span> <span class="n">color_list</span><span class="p">[</span><span class="n">mask_color_id</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">color_list</span>