Verify Color : Chrome is RGBA but Firefox is RGB

1,192 views
Skip to first unread message

Phuong the

unread,
Mar 24, 2017, 4:19:13 AM3/24/17
to Galen Framework
Hi all,

I meet the trouble with verify color on Chrome and Firefox

when run galen script on Chrome, the color always is RBGA ( ex : "rgba(244, 0, 14, 1)" )  while Firefox is RGB , ex : "rgb(244, 0, 14)" 

does anyone have solution for this case ? 

thanks,
Phuong Nguyen.

Phuong the

unread,
Mar 24, 2017, 4:21:33 AM3/24/17
to Galen Framework
I'm using galen 2.3.2 and sublime text 

danie...@klarna.com

unread,
Apr 7, 2017, 7:25:34 AM4/7/17
to Galen Framework
Same problem here. Anyone can help on this?

Ivan Shubin

unread,
Apr 18, 2017, 7:52:46 AM4/18/17
to Galen Framework
Hi,

Galen only allows you to verify the string value of computed CSS style. Different browsers may format it differently. So there is no easy way to solve this issue at the moment

Regards,
Ivan
Message has been deleted

bethany...@gmail.com

unread,
May 30, 2017, 6:25:46 AM5/30/17
to Galen Framework
We have a solution for this - change the spec from:

css color is "rgba(51, 51, 51, 1)"


 to 

css color matches "rgb(a)?\(51, 51, 51(, 1)?\)"



Ideally we'd make a rule that uses the above but currently that's our solution.

SwooshAaoosh

unread,
Jul 10, 2017, 6:55:15 PM7/10/17
to Galen Framework
I was doing: 

css color contains "51, 51, 51"

but that looks much cooler Bethany, I'll try that, Thanks
Message has been deleted

Thành Hoàng

unread,
Dec 7, 2017, 4:16:58 AM12/7/17
to Galen Framework
It not work for me
Please help

Mark

unread,
Dec 19, 2017, 6:05:50 PM12/19/17
to Galen Framework
I've been playing around with this for a while and the test is still failing


Test:
css color matches "rgb(a)?\(0, 125, 184(, 1)?\)"

Test report:
css property "color" is "rgba(0, 125, 184, 1)" but should match "rgb(a)?(0, 125, 184(, 1)?)"

Mark

unread,
Dec 19, 2017, 6:16:04 PM12/19/17
to Galen Framework
Using double backslashes solved the issue:

cza...@gmail.com

unread,
Feb 1, 2018, 9:17:57 AM2/1/18
to Galen Framework
hi all, I'm facing similar issue. Browser returns "rgba(0, 0, 0, 0)" once and "transparent"  another time.
None of solutions I tried works. 
Tried: css background-color matches "transparent|rgba(0, 0, 0, 0)" and others. Missing simple OR operator.
Any solution for this?
thanks
Karol
Message has been deleted

jayesh.p...@zeuslearning.com

unread,
May 31, 2018, 9:57:23 AM5/31/18
to Galen Framework
 Sorry, earlier I had missed a case where if a is not equal to 0, firefox and ie returns "rgba(244, 0, 14, 1)" .  Here is the updated rule:

@rule %{itemPattern} has %{fontFamily} %{r} %{g} %{b} %{a} %{fontSize} %{fontWeight}
@forEach [${itemPattern}] as item
${item}:
@if ${a == 1}
@on firefox, edge
css color is "rgb(${r}, ${g}, ${b})"
@on chrome, ie
css color is "rgba(${r}, ${g}, ${b}, ${a})"
@else
css color is "rgba(${r}, ${g}, ${b}, ${a})"
css font-family contains ${fontFamily}
css font-size is ${fontSize}
css font-weight is ${fontWeight}
Reply all
Reply to author
Forward
0 new messages