def stepDensify(startColor, steps, direction):

    colorSteps = []
   
   
    colorSteps.append([startColor[0],startColor[1],startColor[2]])
   
    lastColor   = startColor
    colorsAdded = 0
    colorsAvail = [True,True,True]
   
    while steps < colorsAdded:
        for index in range(0,3):
       
            newColor = lastColor[index] + (1 * direction)
       
            if newColor < 0 or newColor > 255: 
                colorsAvail[index] = False
                continue
        
            lastColor[index] = newColor
            colorSteps.append([lastColor[0],lastColor[1],lastColor[2]])
            
            colorsAdded = colorsAdded + 1
            
            if colorsAdded >= steps: break
            
        if (not colorsAvail[0]) and (not colorsAvail[1]) and (not colorsAvail[2]):
            exit("Step densification failed!")
           
    return colorSteps


## START Parse SLD v1.0.0 ##
dataset/ETHPy150Open nasa-gibs/onearth/src/scripts/SLDtoColorMap.py/stepDensify/swapped operands of `<`