Canvas2D: Remove rgba and hsla color strings support


Qt Quick Canvas (and Canvas2D) has supported colors from "rgba(...)"
and "hsla(...)" strings. This support has however been only partial
and the brush value classes taking in QColor don't support these.

Remove this support from Canvas2D and prefer Qt.rgba(), "#aarrggbb"
and "red" formats. This reduces compatibility with the HTML canvas &
Quick Canvas, but it also unifies color support with QColor and QML
colors, and improves performance by directing users to better
performing options.

Also, fillStyle & strokeStyle getters now return colors in
"#RRGGBB" or "#AARRGGBB" format. Tested with both Chrome and Firefox
that this is different from HTML canvas where the return value is
"rgba(R, G, B, A)" when the alpha < 1.0. But as we don't support
that, #AARRGGBB should be fine.

Pick-to: 6.12
Task-number: QTBUG-151002
Change-Id: Icdc27c7459d640e3cca4178a57bfa7701b184b13
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commitc470088a20689228633ec010e7c5a4727b9fbf45
parent9301322208bf6ad896b40514c64ee11a483f353a
authorKaj Grönholm <kaj.gronholm@qt.io>
committerKaj Grönholm <kaj.gronholm@qt.io>
commit timeWed, 30 Sep 2026 13:00:31 +0000