RGB TO HSI PYTHON

0

I have this function:

def RGB_TO_HSI(R,G,B):
    if(0<=R<=255 and 0<=G<=255 and 0<=B<=255):
    d = float(R + G + B)
    r = float(R)/d
    g = float(G)/d
    b = float(B)/d
    numerador = float( 0.5 * ((r - g) + (r - b)))
    denominador = float(((r - g) * (r - g) + (r - b) * (g - b))**(0.5))
    if(b < = g):
        h = math.acos(numerador / denominador )
    if(b > g):
        h = (2*math.pi) -  math.acos(numerador/denominador )
     s = 1 - (3 * min(r,g,b))
     i = float(R + G+ B)/float(3*255)
     H = h*(180/math.pi)
     S = s*100
     I = i*255
     return H
     return S
     return I

And when I try to execute, I get this error:

IndentationError: expected an indented block

I do not understand what you mean, if it's index or something else, if someone could tell me what I could do I would appreciate it.

The error is in line d = float(R+G+B) Thanks

    
asked by Basilio Saldarriaga 03.10.2018 в 05:35
source

0 answers