Skip to content

Commit 7d41178

Browse files
committed
Fix Float32Array check
1 parent cad5a03 commit 7d41178

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

package/cpp/api/JsiSkColor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ class JsiSkColor : public RNJsi::JsiHostObject {
7777
runtime, SkColorSetARGB(color.a * 255, color.r, color.g, color.b));
7878
} else if (arguments[0].isObject()) {
7979
auto obj = arguments[0].getObject(runtime);
80-
if (obj.isArrayBuffer(runtime)) {
81-
return obj;
82-
} else if (obj.isArray(runtime)) {
80+
if (obj.isArray(runtime)) {
8381
auto array = obj.asArray(runtime);
8482
double r = std::clamp(array.getValueAtIndex(runtime, 0).getNumber(),
8583
0.0, 255.0);
@@ -90,6 +88,8 @@ class JsiSkColor : public RNJsi::JsiHostObject {
9088
double a = std::clamp(array.getValueAtIndex(runtime, 3).getNumber(),
9189
0.0, 255.0);
9290
return JsiSkColor::toValue(runtime, SkColorSetARGB(a, r, g, b));
91+
} else if (obj.hasProperty(runtime, jsi::PropNameID::forAscii(runtime, "buffer"))) {
92+
return obj;
9393
}
9494
}
9595
return jsi::Value::undefined();

0 commit comments

Comments
 (0)