fix(color): support web standard #rrggbbaa format

original pr credit to @farfromrefug
https://github.com/NativeScript/NativeScript/pull/8519

BREAKING CHANGE

Long standing inconsistency with color handling here.

BEFORE:

```
// #aarrggbb

const color = new Color('#ff00ff00');

Label {
    background-color: #ff00ff00;
}
```

AFTER:

```
// #rrggbbaa

const color = new Color('#00ff00ff');

Label {
    background-color: #00ff00ff;
}
```
This commit is contained in:
Nathan Walker
2021-03-06 20:27:29 -08:00
parent e9b5eb934d
commit aaeab990c8
10 changed files with 36 additions and 28 deletions

View File

@@ -295,8 +295,8 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
const label = this.testView;
const fontSize = 14;
const color = '#FFFF0000';
const backgroundColor = '#FF00FF00';
const color = '#FF0000FF';
const backgroundColor = '#00FF00FF';
const testCss = ['.title {background-color: ', backgroundColor, '; ', 'color: ', color, '; ', 'font-size: ', fontSize, ';}'].join('');
// >> label-cssclass
@@ -566,7 +566,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
let view = this.testView;
let page = this.testPage;
this.waitUntilTestElementIsLoaded();
let expectedColor = '#FFFF0000';
let expectedColor = '#FF0000FF';
let expectedNormalizedColor = '#FF0000';
page.css = 'label:disabled { background-color: ' + expectedColor + '; }';