Could you please mark the answer that help you as a solution? You see a big green "Accept as Solution" button next to it. It will help other community members who will face a similar situation. Thanks.
While I was searching for something else I happened upon something and thought it might be of assistance to you. The smartbear support for handling browser differences has a secion about attribute values that looks specifically at how to handle the background color in different browsers as an example
Thanks for the link. This will help me understand what I am doing wrong.
Glad it could help
What stood out to me is that it appears the style they are picking up is "backgroundColor" rather than "background-color"
I always do, when I have found a solution!
I would like to take the opportunity to point out, that the users are always there to help, more than support people. Especially Robert has always been there and help solve 95% of my problems!! I can not thank him and all other experts that have helped me.
Sorry for delayed response. It took me a while but finally figured it out. Thanks for pointing me to right direction. This is what finally worked:
var previewColor = previewSwatch.ownerDocument.defaultView.getComputedStyle(previewSwatch, "").backgroundColor;
I'm so glad to hear that the solution has been found