Add `Animated.Color` node · rescript-react-native/rescript-react-native@a761012

Original file line numberDiff line numberDiff line change

@@ -196,6 +196,22 @@ module ValueXY = {

196196

external getTranslateTransform: t => array<Style.transform> = "getTranslateTransform"

197197

}

198198
199+

module Color = {

200+

include ValueMethods({

201+

type t = {"r": Value.t, "g": Value.t, "b": Value.t, "a": Value.t}

202+

type rawValue = {"r": float, "g": float, "b": float, "a": float}

203+

type addListenerCallback = rawValue => unit

204+

})

205+
206+

@obj external rgbaValue: (~r: float, ~g: float, ~b: float, ~a: float) => rawValue = ""

207+
208+

@new @scope("Animated") @module("react-native")

209+

external create: rawValue => t = "Color"

210+
211+

@new @scope("Animated") @module("react-native")

212+

external createFromString: Color.t => t = "Color"

213+

}

214+
199215

@module("react-native") @scope("Animated")

200216

external delay: float => Animation.t = "delay"

201217