Sweet, thanks Ivan!
I won't even try to understand this but it works.

frank


On 28/12/15 8:25 pm, Ivan Busquets wrote:
Hey Frank,

Found this buried inside some old backdrop-utilities module. I think it should work for what you're after.

def TILEtoRGB(V):

    '''

    TILEtoRGB(V) -> tuple

    Returns a tuple representing Red, Green, and Blue values

in a 0-1 range, from a 32 bit int as returned by the "tile_color" knob.

    Keyword arguments:

    V -- a 32 bit int as returned by the "tile_color" knob

    '''


    R = (0xFF & V >> 24) / 255.0

    G = (0xFF & V >> 16) / 255.0

    B = (0xFF & V >> 8) / 255.0

    return R,G,B



Hope it helps!



On Sun, Dec 27, 2015 at 11:11 PM, Frank Rueter|OHUfx <[email protected] <mailto:[email protected]>> wrote:

    Hi guys,

    after years of begrudgingly having to convert rgb to tile colour
    friendly values, I now need to do the opposite, i.e. take a tile
    color value and get rgb values from it.

    How do I do that?

    Cheers,
    frank


-- ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing
    <http://ohufx.com/index.php/vfx-compositing> | *workflow
    customisation and consulting
    <http://ohufx.com/index.php/vfx-customising>* *


    _______________________________________________
    Nuke-python mailing list
    [email protected]
    <mailto:[email protected]>,
    http://forums.thefoundry.co.uk/
    http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python




_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *

_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to