[Solved] Shader color decimal values

More data I'm trying to access by script... the color values displayed for Iray Uber Shader colors are expressed as between 0 and 1, and are what I need to use in my scripting; when passed to my external app, they give me a matching color. I can't seem to access them, though. The value is not the 0-255 value divided by 255; that's signficantly off. Does anyone know how this is computed or where it can be accessed?

EDIT: The correct values also show up in the diffuse values used by the OBJ exporter; they've got to be in there somewhere!

Screen Shot 2015-12-22 at 12.56.02 PM.png
982 x 558 - 78K
Post edited by Jack of Spades on

Comments

  • barbultbarbult Posts: 24,245
    edited December 2015

    deleted - I misinterpreted the question - sorry.

    Post edited by barbult on
  • I figured it out; I had to back out the gamma correction.

    function toRGBVector( color ){	red = round( Math.pow( color.red / 255, 2.2 ) );	green = round( Math.pow( color.green / 255, 2.2 ) );	blue = round( Math.pow( color.blue / 255, 2.2 ) );	return "[ " + red + ", " + green + ", " + blue + ", 1 ]"}
    			
Sign In or Register to comment.