How to get the color of a textnode
Hi all,
I have a question about the colort of a textnode. Please look at the following two textnodes. I am trying to achieve their color by using the following code:
var pin7= Aliases.home.panel1.textnodePin7;
var cc= pin7.style.color;
var bc= pin7.style.backgroudcolor;
Log.Message(cc+bc);
But I always get the empty string for the colors? Which function is correct for achieving their colors?
Best Regards,
Jie
Not that simple usually I'm afraid.
The colours are likey part of a stylesheet? (CSS layer)
It's this you need to interpret in order to get the colours in use. And you'll sometimes find that different browsers report CSS differently. (I forget exactly how. But I have a feeling it may be transparencies or something? I certainly remember hitting a few differences between IE and Chrome.)
And you may also find you run into transparencies in order to allow the colour from a object layered below it to show through.
And sometimes that may be conditional. (ie - sometimes it will be transparent, sometimes not, depending on the logic in the code)
And you may also have an opacity setting to factor in. (How see-through, or not, something is.)
Here is the code I need to use (VBScript) to get the colour info back from the last web application I was working on:
object_backgroundcolour = <OBJECT>.ownerDocument.defaultView.getComputedStyle(<OBJECT>, "").backgroundColor