Let's create several buttons which will shift our colors
Canvasand create a new child
HorizontalLayoutGroupscript on it set
horizontalFit=PreferredSizeso your object will looks as
Now our root objects for our colors is ready and it would have nice feature. it would grow automatically and you can add several colors and all of them would be automactically aligned. so let's do that
GameObject/UI/Buttonand make it as child for our
ColorsPaletteelement and name it 'ColorButton'
Textchild object of our button. so you won't have any caption on it
ColorButtonand set "PrefferedWidth=30"
ImageComponentand click on
Colorproperty and in dropdown list select required color
ChangeColorOnClickControllerAnd finaly copy our colors from our Image component to this controller. To Do that you need to select component menu (little gear at the top right corner of our component) and select
Copy Color from Image
LineConfigad you did that in tool change step.
LineConfigand every one has the same color as button.
Click play button and try to change line of your color