2

I read in an old qooxdoo note that "qx.util.ColorUtil now accepts rgba values for cssStringToRgb()". This means to me that qoxdoo has the ability to deal with rgba colors in some ways.

But none of the ways I tried to set colors in a theme extending qx.theme.modern.Color has been parsed by qoxxdoo : throw new Error("Could not parse color: " + temp); Is it a bug (may I open a ticket?) or is my way of setting color variables bad ?

Thanks for your replies.

Julien B
  • 71
  • 5

2 Answers2

2

qooxdoo's theming system doesn't support rgba since (at least AFAIK) there's no way to implement it for older browsers such as Opera 9.x. You're getting that error because rgba strings aren't considered valid color definitions.

qx.util.ColorUtil.cssStringToRgb only deals with rgba strings in that it returns the color values, stripping the alpha channel value.

Daniel Wagner
  • 2,717
  • 1
  • 21
  • 14
  • >qx.util.ColorUtil.cssStringToRgb only deals with rgba strings in that it returns the color values, stripping the alpha channel value.< The same behaviour could have been expected with rgba values defined in Color.js. Alpha colors are a great way to deal with colors (especiallly for enabled/disabled texts, labels and buttons). But it might break the pixel-perfect consistency that Qooxdoo tries to maintain across browsers. Whatever, thank-your for your answer. – Julien B Jul 12 '10 at 06:56
  • although this is an old question i figured it might be interesting to some people that current qooxdoo versions have rgba support. please see my answer for details. – Alp Oct 28 '15 at 12:30
-1

It is actually possible. Instead of assigning a string with the hex representation of the color, you can assign an array of rgb(a) values:

[255, 0, 0, .5]

which is an equivalent of

rgba(255, 0, 0, .5)

and appears as half-transparent red.

Alp
  • 29,274
  • 27
  • 120
  • 198
  • Nope, at least not in Qooxdoo 1.5.1. Although it is said here http://news.qooxdoo.org/the-week-in-qooxdoo-2011-04-21 that it was added in 1.5. Weird... – xarlymg89 Feb 15 '16 at 17:13
  • you might want to upgrade your qooxdoo installation. you are 4 (four!) major versions behind. it definitely works in more recent releases. – Alp Feb 15 '16 at 19:27
  • I wish I could :S But thank you anyway, I sorted it out finding the DOM element, and applying there the CSS rgba color. :) – xarlymg89 Feb 16 '16 at 14:21
  • Yes, that's a good workaround. I guess it's `.getContentElement().getDOMElement()`? – Alp Feb 16 '16 at 18:13
  • Yes, I got to use the appear event, since the DOM won't be available until the element is shown in the browser. – xarlymg89 Feb 17 '16 at 09:33