Creating a slider that changes a single color channel
In this recipe, we are going to see how to provide the player with the ability to completely customize the color of something. In this case, we will allow the player to customize an Image (Script) component. It is important to keep in mind that we are not limited to customizing just the Image (Script) component. In fact, we can change everything that has a color, including lights. Changing lights is useful if you want to create ambience and immersive UIs. This is associated with what you learned in Chapter 4, Creating Panels for Menus, in the Making UI Elements affected by different lights recipe. Compared to the Creating a button that changes color and Creating a slider that changes colors gradually recipes, here the player will be able to change colors in a better way. He will be able to tweak every color channel.
In order to implement all of this, we need to create a slider that controls, through a script, the single color channel,...