Skip to content

Commit bc41a60

Browse files
committed
fix: return colors as Color
1 parent d9acc61 commit bc41a60

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function nativeColorProperty(...args) {
1717
if (typeof value === 'string') {
1818
return value;
1919
}
20-
return new Color((value as com.carto.graphics.Color).getARGB()).hex;
20+
return new Color((value as com.carto.graphics.Color).getARGB());
2121
},
2222
toNative(value) {
2323
const theColor = value instanceof Color ? value : value._argb ? new Color(value._argb) : new Color(value);

src/index.ios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export function nativeColorProperty(...args) {
1313
return nativeProperty(
1414
{
1515
converter: {
16-
fromNative(value) {
17-
return new Color(value.getARGB() as number).hex;
16+
fromNative(value: NTColor) {
17+
return new Color(value.getARGB());
1818
},
19-
toNative(value) {
19+
toNative(value): NTColor {
2020
const theColor = value instanceof Color ? value : value._argb ? new Color(value._argb) : new Color(value);
2121
return NTColor.alloc().initWithRGBA(theColor.r, theColor.g, theColor.b, theColor.a);
2222
}

0 commit comments

Comments
 (0)