Thank-you to all.
By using the help from each of you and adding it to my growing bucket of knowledge, I have been able to achieve what I was trying to achieve. I still have a lot of work to do, but with your help I'm back on track.
BTW, I now know that the thing that was tripping me up by confusion was that when I print a LOG of the detected colour, it often shows simply as -1. But if I plug that value in to the CSSUTILS.SetBackgroundColor command regardless, it works.