.. meta:: :description: Code snippets discrete LUT How to create a discrete LUT and apply it to a Channel ====================================================== In this example, we will apply a Lookup Table to a Channel called ``channel`` to a scene:: import numpy as np from ORSServiceClass.ORSWidget.orslutwidget.orslutlogic import OrsLUTLogic lutName = 'a LUT Name' aLUT = OrsLUTLogic.createLUT(lutName) aLUT.setIsDiscrete(True) aLUT.setTableSize(channel.getMaximumValue()) for i in range(np.int(channel.getMaximumValue() + 1)): r, g, b = np.random.rand(3) color = Color(r, g, b, 1.0) aLUT.setColorAtIndex(i, color) lutUUID = OrsLUTLogic.getLUTUUID(aLUT) Then use the snippet of :ref:`add_LUT_to_dataset_on_view` to apply this LUT to a channel.