Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/r/h/rhinopython-HEAD/scripts/rhinoscript/utility.py   rhinopython(Download)
    """
    rgb = coercecolor(rgb, True)
    hsl = Rhino.Display.ColorHSL(rgb)
    luma = luma / 1000.0
    if scale: luma = hsl.L + luma
def ColorHLSToRGB(hls):
    "Converts colors from hue-lumanence-saturation to RGB"
    if len(hls)==3:
        hls = Rhino.Display.ColorHSL(hls[0]/240.0, hls[2]/240.0, hls[1]/240.0)
    elif len(hls)==4:
        hls = Rhino.Display.ColorHSL(hls[3]/240.0, hls[0]/240.0, hls[2]/240.0, hls[1]/240.0)
def ColorRGBToHLS(rgb):
    "Convert colors from RGB to HLS"
    rgb = coercecolor(rgb, True)
    hsl = Rhino.Display.ColorHSL(rgb)
    return hsl.H, hsl.S, hsl.L