1 | import { ColorBase } from './color-common';
|
2 | export class Color extends ColorBase {
|
3 | get ios() {
|
4 | if (!this._ios) {
|
5 |
|
6 | this._ios = UIColor.alloc().initWithRedGreenBlueAlpha(this.r / 255, this.g / 255, this.b / 255, this.a / 255);
|
7 | }
|
8 | return this._ios;
|
9 | }
|
10 | static fromIosColor(value) {
|
11 | const r = new interop.Reference();
|
12 | const g = new interop.Reference();
|
13 | const b = new interop.Reference();
|
14 | const a = new interop.Reference();
|
15 | value.getRedGreenBlueAlpha(r, g, b, a);
|
16 | return new Color(Math.round(a.value * 255), Math.round(r.value * 255), Math.round(g.value * 255), Math.round(b.value * 255));
|
17 | }
|
18 | }
|
19 |
|
\ | No newline at end of file |