   p16ColourLow8 1
   p16ColourHigh8 248
   lIndex = 8
   For b = 0 To &amp;HFF Step &amp;H33
      For g = 0 To &amp;HFF Step &amp;H33
         For r = 0 To &amp;HFF Step &amp;H33
            ' ignore if the output is any combination of 0 and FF
            l = r + g + b
            If l = 0 Or l = &amp;H2FD Then
               ' ignore
            ElseIf l = &amp;H1FE And (r = 0 Or g = 0 Or b = 0) Then
               ' ignore
            ElseIf l = &amp;HFF And ((r = 0 And g = 0) Or (r = 0 And b = 0) Or (