diff --git a/package/cpp/api/JsiSkColor.h b/package/cpp/api/JsiSkColor.h index c2503b3ec5..c55639cae8 100644 --- a/package/cpp/api/JsiSkColor.h +++ b/package/cpp/api/JsiSkColor.h @@ -77,9 +77,7 @@ class JsiSkColor : public RNJsi::JsiHostObject { runtime, SkColorSetARGB(color.a * 255, color.r, color.g, color.b)); } else if (arguments[0].isObject()) { auto obj = arguments[0].getObject(runtime); - if (obj.isArrayBuffer(runtime)) { - return obj; - } else if (obj.isArray(runtime)) { + if (obj.isArray(runtime)) { auto array = obj.asArray(runtime); double r = std::clamp(array.getValueAtIndex(runtime, 0).getNumber(), 0.0, 255.0); @@ -90,6 +88,8 @@ class JsiSkColor : public RNJsi::JsiHostObject { double a = std::clamp(array.getValueAtIndex(runtime, 3).getNumber(), 0.0, 255.0); return JsiSkColor::toValue(runtime, SkColorSetARGB(a, r, g, b)); + } else if (obj.hasProperty(runtime, jsi::PropNameID::forAscii(runtime, "buffer"))) { + return obj; } } return jsi::Value::undefined();