Why is the gray box I got not accepted as a Graphics directive

I was working with using DomiantColors and the code provided from the Creative Computation course worked. But my code did not I have tried different codes but every time it says not a graphics directive. But when i use it with some other code already done it works. Or manually type in the RGB numbers. But why isn’t it working for the code I created it seems that something is missing here. What am I missing? How can I improve. I would like to be able to do the same thing for using “color squares” I can’t find the documentation explaining what the color square is.

I also tried this but will not work either.

So why do I have to manually type in the RGB color? But this code will work.

Thanks for your help!

Pay attention to where the curly braces are.

Yeah that seems to be the problem. I did try changing around the braces and I learned how to check them from that work. I still could not really fix it until today. I was able to get the code that I was working on before to work. I tried changing the before braces but I probably changed some other things at the same time and causing problems.

Good feedback.