Changes the luminance of a red-green-blue (RGB) value. Hue and saturation are not affected.
rhinoscriptsyntax.ColorAdjustLuma (rgb, luma, scale=False)
rhinoscript.utility.ColorAdjustLuma (rgb, luma, scale=False)
rgb |
Required. Number. The initial RGB color value. |
luma |
Required. Number. The luminance in units of 0.1 percent of the total range. For example, a value of luma = 50 corresponds to 5 percent of the maximum luminance. |
scale |
Optional. Boolean. If scale is set to True, luma specifies how much to increment or decrement the current luminance. If scale is set to False, luma specifies the absolute luminance. The default value is False. |
If scale is set to True, luma can range from -1000 to +1000.
If scale is set to False, luma can range from 0 to 1000. Available luminance values range from 0 to a maximum. If the requested value is negative or exceeds the maximum, the luminance will be set to either zero or the maximum value, respectively.
Number |
The modified RGB color value if successful. |
None |
If not successful or on error. |
import rhinoscriptsyntax as rs
rgb = rs.ColorAdjustLuma((128, 128, 128), 50)
print "Red = ", rs.ColorRedValue(rgb)
print "Green = ", rs.ColorGreenValue(rgb)
print "Blue = ", rs.ColorBlueValue(rgb)