reanimated-color-picker 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +79 -79
  3. package/lib/commonjs/AppContext.js.map +1 -22
  4. package/lib/commonjs/ColorPicker.js +136 -133
  5. package/lib/commonjs/ColorPicker.js.map +1 -119
  6. package/lib/commonjs/colorKit/colorConversion/HEX.js +92 -0
  7. package/lib/commonjs/colorKit/colorConversion/HEX.js.map +1 -0
  8. package/lib/commonjs/colorKit/colorConversion/HSL.js +163 -0
  9. package/lib/commonjs/colorKit/colorConversion/HSL.js.map +1 -0
  10. package/lib/commonjs/colorKit/colorConversion/HSV.js +195 -0
  11. package/lib/commonjs/colorKit/colorConversion/HSV.js.map +1 -0
  12. package/lib/commonjs/colorKit/colorConversion/HWB.js +167 -0
  13. package/lib/commonjs/colorKit/colorConversion/HWB.js.map +1 -0
  14. package/lib/commonjs/colorKit/colorConversion/RGB.js +206 -0
  15. package/lib/commonjs/colorKit/colorConversion/RGB.js.map +1 -0
  16. package/lib/commonjs/colorKit/colorConversion/index.js +297 -0
  17. package/lib/commonjs/colorKit/colorConversion/index.js.map +1 -0
  18. package/lib/commonjs/colorKit/colorInformation.js +165 -166
  19. package/lib/commonjs/colorKit/colorInformation.js.map +1 -98
  20. package/lib/commonjs/colorKit/colorManipulation.js +464 -464
  21. package/lib/commonjs/colorKit/colorManipulation.js.map +1 -92
  22. package/lib/commonjs/colorKit/colorUtilities.js +169 -194
  23. package/lib/commonjs/colorKit/colorUtilities.js.map +1 -76
  24. package/lib/commonjs/colorKit/colorsRegex.js +2 -2
  25. package/lib/commonjs/colorKit/colorsRegex.js.map +1 -27
  26. package/lib/commonjs/colorKit/index.js +1 -1
  27. package/lib/commonjs/colorKit/index.js.map +1 -41
  28. package/lib/commonjs/colorKit/namedColors.js +2 -2
  29. package/lib/commonjs/colorKit/namedColors.js.map +1 -160
  30. package/lib/commonjs/colorKit/types.js.map +1 -10
  31. package/lib/commonjs/colorKit/utilities.js +59 -0
  32. package/lib/commonjs/colorKit/utilities.js.map +1 -33
  33. package/lib/commonjs/components/InputWidget/InputWidget.js +14 -15
  34. package/lib/commonjs/components/InputWidget/InputWidget.js.map +1 -110
  35. package/lib/commonjs/components/InputWidget/Widgets/HexWidget.js +14 -15
  36. package/lib/commonjs/components/InputWidget/Widgets/HexWidget.js.map +1 -77
  37. package/lib/commonjs/components/InputWidget/Widgets/HslWidget.js +15 -16
  38. package/lib/commonjs/components/InputWidget/Widgets/HslWidget.js.map +1 -92
  39. package/lib/commonjs/components/InputWidget/Widgets/HsvWidget.js +15 -16
  40. package/lib/commonjs/components/InputWidget/Widgets/HsvWidget.js.map +1 -91
  41. package/lib/commonjs/components/InputWidget/Widgets/HwbWidget.js +15 -16
  42. package/lib/commonjs/components/InputWidget/Widgets/HwbWidget.js.map +1 -92
  43. package/lib/commonjs/components/InputWidget/Widgets/RgbWidget.js +15 -16
  44. package/lib/commonjs/components/InputWidget/Widgets/RgbWidget.js.map +1 -91
  45. package/lib/commonjs/components/InputWidget/Widgets/WidgetTextInput.js +12 -13
  46. package/lib/commonjs/components/InputWidget/Widgets/WidgetTextInput.js.map +1 -98
  47. package/lib/commonjs/components/Panels/Panel1.js +15 -17
  48. package/lib/commonjs/components/Panels/Panel1.js.map +1 -148
  49. package/lib/commonjs/components/Panels/Panel2.js +19 -21
  50. package/lib/commonjs/components/Panels/Panel2.js.map +1 -166
  51. package/lib/commonjs/components/Panels/Panel3.js +17 -19
  52. package/lib/commonjs/components/Panels/Panel3.js.map +1 -166
  53. package/lib/commonjs/components/Panels/Panel4.js +17 -19
  54. package/lib/commonjs/components/Panels/Panel4.js.map +1 -157
  55. package/lib/commonjs/components/Panels/Panel5.js +10 -12
  56. package/lib/commonjs/components/Panels/Panel5.js.map +1 -128
  57. package/lib/commonjs/components/Preview.js +17 -41
  58. package/lib/commonjs/components/Preview.js.map +1 -117
  59. package/lib/commonjs/components/PreviewText.js +3 -5
  60. package/lib/commonjs/components/PreviewText.js.map +1 -61
  61. package/lib/commonjs/components/Sliders/{BrightnessSlider.js → HSB/BrightnessSlider.js} +20 -25
  62. package/lib/commonjs/components/Sliders/HSB/BrightnessSlider.js.map +1 -0
  63. package/lib/commonjs/components/Sliders/{HueSlider.js → HSB/HueSlider.js} +20 -25
  64. package/lib/commonjs/components/Sliders/HSB/HueSlider.js.map +1 -0
  65. package/lib/commonjs/components/Sliders/{SaturationSlider.js → HSB/SaturationSlider.js} +20 -25
  66. package/lib/commonjs/components/Sliders/HSB/SaturationSlider.js.map +1 -0
  67. package/lib/commonjs/components/Sliders/HueCircular.js +15 -20
  68. package/lib/commonjs/components/Sliders/HueCircular.js.map +1 -167
  69. package/lib/commonjs/components/Sliders/OpacitySlider.js +16 -21
  70. package/lib/commonjs/components/Sliders/OpacitySlider.js.map +1 -167
  71. package/lib/commonjs/components/Sliders/RGB/BlueSlider.js +15 -20
  72. package/lib/commonjs/components/Sliders/RGB/BlueSlider.js.map +1 -158
  73. package/lib/commonjs/components/Sliders/RGB/GreenSlider.js +15 -20
  74. package/lib/commonjs/components/Sliders/RGB/GreenSlider.js.map +1 -158
  75. package/lib/commonjs/components/Sliders/RGB/RedSlider.js +15 -20
  76. package/lib/commonjs/components/Sliders/RGB/RedSlider.js.map +1 -158
  77. package/lib/commonjs/components/Swatches.js +1 -2
  78. package/lib/commonjs/components/Swatches.js.map +1 -41
  79. package/lib/commonjs/components/Thumb/BuiltinThumbs/Circle.js +3 -2
  80. package/lib/commonjs/components/Thumb/BuiltinThumbs/Circle.js.map +1 -61
  81. package/lib/commonjs/components/Thumb/BuiltinThumbs/DoubleTriangle.js +2 -2
  82. package/lib/commonjs/components/Thumb/BuiltinThumbs/DoubleTriangle.js.map +1 -70
  83. package/lib/commonjs/components/Thumb/BuiltinThumbs/Hollow.js +3 -2
  84. package/lib/commonjs/components/Thumb/BuiltinThumbs/Hollow.js.map +1 -62
  85. package/lib/commonjs/components/Thumb/BuiltinThumbs/Line.js +3 -2
  86. package/lib/commonjs/components/Thumb/BuiltinThumbs/Line.js.map +1 -62
  87. package/lib/commonjs/components/Thumb/BuiltinThumbs/Pill.js +3 -2
  88. package/lib/commonjs/components/Thumb/BuiltinThumbs/Pill.js.map +1 -62
  89. package/lib/commonjs/components/Thumb/BuiltinThumbs/Plus.js +3 -2
  90. package/lib/commonjs/components/Thumb/BuiltinThumbs/Plus.js.map +1 -67
  91. package/lib/commonjs/components/Thumb/BuiltinThumbs/Rect.js +3 -2
  92. package/lib/commonjs/components/Thumb/BuiltinThumbs/Rect.js.map +1 -61
  93. package/lib/commonjs/components/Thumb/BuiltinThumbs/Ring.js +5 -4
  94. package/lib/commonjs/components/Thumb/BuiltinThumbs/Ring.js.map +1 -70
  95. package/lib/commonjs/components/Thumb/BuiltinThumbs/Solid.js +3 -2
  96. package/lib/commonjs/components/Thumb/BuiltinThumbs/Solid.js.map +1 -60
  97. package/lib/commonjs/components/Thumb/BuiltinThumbs/TriangleDown.js +2 -2
  98. package/lib/commonjs/components/Thumb/BuiltinThumbs/TriangleDown.js.map +1 -69
  99. package/lib/commonjs/components/Thumb/BuiltinThumbs/TriangleUp.js +2 -2
  100. package/lib/commonjs/components/Thumb/BuiltinThumbs/TriangleUp.js.map +1 -69
  101. package/lib/commonjs/components/Thumb/BuiltinThumbs/index.js.map +1 -41
  102. package/lib/commonjs/components/Thumb/Thumb.js +158 -159
  103. package/lib/commonjs/components/Thumb/Thumb.js.map +1 -76
  104. package/lib/commonjs/index.js +7 -7
  105. package/lib/commonjs/index.js.map +1 -50
  106. package/lib/commonjs/styles.js +0 -4
  107. package/lib/commonjs/styles.js.map +1 -77
  108. package/lib/commonjs/types.js.map +1 -10
  109. package/lib/commonjs/utils.js +17 -14
  110. package/lib/commonjs/utils.js.map +1 -91
  111. package/lib/module/AppContext.js.map +1 -19
  112. package/lib/module/ColorPicker.js +136 -133
  113. package/lib/module/ColorPicker.js.map +1 -88
  114. package/lib/module/colorKit/colorConversion/HEX.js +78 -0
  115. package/lib/module/colorKit/colorConversion/HEX.js.map +1 -0
  116. package/lib/module/colorKit/colorConversion/HSL.js +146 -0
  117. package/lib/module/colorKit/colorConversion/HSL.js.map +1 -0
  118. package/lib/module/colorKit/colorConversion/HSV.js +178 -0
  119. package/lib/module/colorKit/colorConversion/HSV.js.map +1 -0
  120. package/lib/module/colorKit/colorConversion/HWB.js +150 -0
  121. package/lib/module/colorKit/colorConversion/HWB.js.map +1 -0
  122. package/lib/module/colorKit/colorConversion/RGB.js +189 -0
  123. package/lib/module/colorKit/colorConversion/RGB.js.map +1 -0
  124. package/lib/module/colorKit/colorConversion/index.js +262 -0
  125. package/lib/module/colorKit/colorConversion/index.js.map +1 -0
  126. package/lib/module/colorKit/colorInformation.js +144 -145
  127. package/lib/module/colorKit/colorInformation.js.map +1 -90
  128. package/lib/module/colorKit/colorManipulation.js +433 -433
  129. package/lib/module/colorKit/colorManipulation.js.map +1 -89
  130. package/lib/module/colorKit/colorUtilities.js +156 -181
  131. package/lib/module/colorKit/colorUtilities.js.map +1 -72
  132. package/lib/module/colorKit/colorsRegex.js +2 -2
  133. package/lib/module/colorKit/colorsRegex.js.map +1 -10
  134. package/lib/module/colorKit/index.js +1 -1
  135. package/lib/module/colorKit/index.js.map +1 -10
  136. package/lib/module/colorKit/namedColors.js +2 -2
  137. package/lib/module/colorKit/namedColors.js.map +1 -157
  138. package/lib/module/colorKit/types.js.map +1 -10
  139. package/lib/module/colorKit/utilities.js +55 -0
  140. package/lib/module/colorKit/utilities.js.map +1 -33
  141. package/lib/module/components/InputWidget/InputWidget.js +12 -13
  142. package/lib/module/components/InputWidget/InputWidget.js.map +1 -81
  143. package/lib/module/components/InputWidget/Widgets/HexWidget.js +12 -13
  144. package/lib/module/components/InputWidget/Widgets/HexWidget.js.map +1 -50
  145. package/lib/module/components/InputWidget/Widgets/HslWidget.js +13 -14
  146. package/lib/module/components/InputWidget/Widgets/HslWidget.js.map +1 -65
  147. package/lib/module/components/InputWidget/Widgets/HsvWidget.js +13 -14
  148. package/lib/module/components/InputWidget/Widgets/HsvWidget.js.map +1 -64
  149. package/lib/module/components/InputWidget/Widgets/HwbWidget.js +13 -14
  150. package/lib/module/components/InputWidget/Widgets/HwbWidget.js.map +1 -65
  151. package/lib/module/components/InputWidget/Widgets/RgbWidget.js +13 -14
  152. package/lib/module/components/InputWidget/Widgets/RgbWidget.js.map +1 -65
  153. package/lib/module/components/InputWidget/Widgets/WidgetTextInput.js +12 -13
  154. package/lib/module/components/InputWidget/Widgets/WidgetTextInput.js.map +1 -65
  155. package/lib/module/components/Panels/Panel1.js +15 -17
  156. package/lib/module/components/Panels/Panel1.js.map +1 -119
  157. package/lib/module/components/Panels/Panel2.js +19 -21
  158. package/lib/module/components/Panels/Panel2.js.map +1 -137
  159. package/lib/module/components/Panels/Panel3.js +17 -19
  160. package/lib/module/components/Panels/Panel3.js.map +1 -137
  161. package/lib/module/components/Panels/Panel4.js +17 -19
  162. package/lib/module/components/Panels/Panel4.js.map +1 -128
  163. package/lib/module/components/Panels/Panel5.js +7 -9
  164. package/lib/module/components/Panels/Panel5.js.map +1 -98
  165. package/lib/module/components/Preview.js +18 -42
  166. package/lib/module/components/Preview.js.map +1 -89
  167. package/lib/module/components/PreviewText.js +3 -5
  168. package/lib/module/components/PreviewText.js.map +1 -32
  169. package/lib/module/components/Sliders/{BrightnessSlider.js → HSB/BrightnessSlider.js} +20 -25
  170. package/lib/module/components/Sliders/HSB/BrightnessSlider.js.map +1 -0
  171. package/lib/module/components/Sliders/{HueSlider.js → HSB/HueSlider.js} +20 -25
  172. package/lib/module/components/Sliders/HSB/HueSlider.js.map +1 -0
  173. package/lib/module/components/Sliders/{SaturationSlider.js → HSB/SaturationSlider.js} +20 -25
  174. package/lib/module/components/Sliders/HSB/SaturationSlider.js.map +1 -0
  175. package/lib/module/components/Sliders/HueCircular.js +15 -20
  176. package/lib/module/components/Sliders/HueCircular.js.map +1 -139
  177. package/lib/module/components/Sliders/OpacitySlider.js +16 -21
  178. package/lib/module/components/Sliders/OpacitySlider.js.map +1 -139
  179. package/lib/module/components/Sliders/RGB/BlueSlider.js +15 -20
  180. package/lib/module/components/Sliders/RGB/BlueSlider.js.map +1 -132
  181. package/lib/module/components/Sliders/RGB/GreenSlider.js +15 -20
  182. package/lib/module/components/Sliders/RGB/GreenSlider.js.map +1 -132
  183. package/lib/module/components/Sliders/RGB/RedSlider.js +15 -20
  184. package/lib/module/components/Sliders/RGB/RedSlider.js.map +1 -132
  185. package/lib/module/components/Swatches.js +1 -2
  186. package/lib/module/components/Swatches.js.map +1 -33
  187. package/lib/module/components/Thumb/BuiltinThumbs/Circle.js +3 -2
  188. package/lib/module/components/Thumb/BuiltinThumbs/Circle.js.map +1 -35
  189. package/lib/module/components/Thumb/BuiltinThumbs/DoubleTriangle.js +3 -3
  190. package/lib/module/components/Thumb/BuiltinThumbs/DoubleTriangle.js.map +1 -42
  191. package/lib/module/components/Thumb/BuiltinThumbs/Hollow.js +3 -2
  192. package/lib/module/components/Thumb/BuiltinThumbs/Hollow.js.map +1 -36
  193. package/lib/module/components/Thumb/BuiltinThumbs/Line.js +13 -2
  194. package/lib/module/components/Thumb/BuiltinThumbs/Line.js.map +1 -36
  195. package/lib/module/components/Thumb/BuiltinThumbs/Pill.js +13 -2
  196. package/lib/module/components/Thumb/BuiltinThumbs/Pill.js.map +1 -36
  197. package/lib/module/components/Thumb/BuiltinThumbs/Plus.js +13 -2
  198. package/lib/module/components/Thumb/BuiltinThumbs/Plus.js.map +1 -41
  199. package/lib/module/components/Thumb/BuiltinThumbs/Rect.js +3 -2
  200. package/lib/module/components/Thumb/BuiltinThumbs/Rect.js.map +1 -35
  201. package/lib/module/components/Thumb/BuiltinThumbs/Ring.js +14 -3
  202. package/lib/module/components/Thumb/BuiltinThumbs/Ring.js.map +1 -43
  203. package/lib/module/components/Thumb/BuiltinThumbs/Solid.js +3 -2
  204. package/lib/module/components/Thumb/BuiltinThumbs/Solid.js.map +1 -34
  205. package/lib/module/components/Thumb/BuiltinThumbs/TriangleDown.js +3 -3
  206. package/lib/module/components/Thumb/BuiltinThumbs/TriangleDown.js.map +1 -41
  207. package/lib/module/components/Thumb/BuiltinThumbs/TriangleUp.js +3 -3
  208. package/lib/module/components/Thumb/BuiltinThumbs/TriangleUp.js.map +1 -42
  209. package/lib/module/components/Thumb/BuiltinThumbs/index.js.map +1 -23
  210. package/lib/module/components/Thumb/Thumb.js +149 -150
  211. package/lib/module/components/Thumb/Thumb.js.map +1 -66
  212. package/lib/module/index.js +5 -5
  213. package/lib/module/index.js.map +1 -30
  214. package/lib/module/styles.js +0 -4
  215. package/lib/module/styles.js.map +1 -73
  216. package/lib/module/types.js.map +1 -10
  217. package/lib/module/utils.js +15 -14
  218. package/lib/module/utils.js.map +1 -84
  219. package/lib/src/{AppContext.js → AppContext.ts} +14 -10
  220. package/lib/src/{ColorPicker.js → ColorPicker.tsx} +159 -135
  221. package/lib/src/colorKit/colorConversion/HEX.ts +85 -0
  222. package/lib/src/colorKit/colorConversion/HSL.ts +149 -0
  223. package/lib/src/colorKit/colorConversion/HSV.ts +183 -0
  224. package/lib/src/colorKit/colorConversion/HWB.ts +152 -0
  225. package/lib/src/colorKit/colorConversion/RGB.ts +196 -0
  226. package/lib/src/colorKit/colorConversion/index.ts +259 -0
  227. package/lib/src/colorKit/{colorInformation.js → colorInformation.ts} +157 -129
  228. package/lib/src/colorKit/{colorManipulation.js → colorManipulation.ts} +335 -281
  229. package/lib/src/colorKit/{colorUtilities.js → colorUtilities.ts} +150 -124
  230. package/lib/src/colorKit/{colorsRegex.js → colorsRegex.ts} +43 -36
  231. package/lib/src/colorKit/index.ts +7 -0
  232. package/lib/src/colorKit/{namedColors.js → namedColors.ts} +149 -148
  233. package/lib/src/colorKit/types.ts +33 -0
  234. package/lib/src/colorKit/utilities.ts +104 -0
  235. package/lib/src/components/InputWidget/{InputWidget.js → InputWidget.tsx} +98 -84
  236. package/lib/src/components/InputWidget/Widgets/{HexWidget.js → HexWidget.tsx} +62 -53
  237. package/lib/src/components/InputWidget/Widgets/{HslWidget.js → HslWidget.tsx} +115 -105
  238. package/lib/src/components/InputWidget/Widgets/{HsvWidget.js → HsvWidget.tsx} +115 -105
  239. package/lib/src/components/InputWidget/Widgets/{HwbWidget.js → HwbWidget.tsx} +115 -105
  240. package/lib/src/components/InputWidget/Widgets/{RgbWidget.js → RgbWidget.tsx} +115 -105
  241. package/lib/src/components/InputWidget/Widgets/{WidgetTextInput.js → WidgetTextInput.tsx} +80 -57
  242. package/lib/src/components/Panels/{Panel1.js → Panel1.tsx} +158 -134
  243. package/lib/src/components/Panels/{Panel2.js → Panel2.tsx} +173 -150
  244. package/lib/src/components/Panels/{Panel3.js → Panel3.tsx} +168 -146
  245. package/lib/src/components/Panels/{Panel4.js → Panel4.tsx} +188 -166
  246. package/lib/src/components/Panels/{Panel5.js → Panel5.tsx} +246 -220
  247. package/lib/src/components/{Preview.js → Preview.tsx} +105 -95
  248. package/lib/src/components/{PreviewText.js → PreviewText.tsx} +24 -17
  249. package/lib/src/components/Sliders/{BrightnessSlider.js → HSB/BrightnessSlider.tsx} +151 -130
  250. package/lib/src/components/Sliders/{HueSlider.js → HSB/HueSlider.tsx} +164 -142
  251. package/lib/src/components/Sliders/{SaturationSlider.js → HSB/SaturationSlider.tsx} +162 -140
  252. package/lib/src/components/Sliders/{HueCircular.js → HueCircular.tsx} +176 -154
  253. package/lib/src/components/Sliders/{OpacitySlider.js → OpacitySlider.tsx} +194 -170
  254. package/lib/src/components/Sliders/RGB/{BlueSlider.js → BlueSlider.tsx} +167 -140
  255. package/lib/src/components/Sliders/RGB/{GreenSlider.js → GreenSlider.tsx} +167 -140
  256. package/lib/src/components/Sliders/RGB/{RedSlider.js → RedSlider.tsx} +167 -140
  257. package/lib/src/components/{Swatches.js → Swatches.tsx} +51 -44
  258. package/lib/src/components/Thumb/BuiltinThumbs/Circle.tsx +36 -0
  259. package/lib/src/components/Thumb/BuiltinThumbs/{DoubleTriangle.js → DoubleTriangle.tsx} +54 -36
  260. package/lib/src/components/Thumb/BuiltinThumbs/{Hollow.js → Hollow.tsx} +41 -21
  261. package/lib/src/components/Thumb/BuiltinThumbs/{Line.js → Line.tsx} +42 -33
  262. package/lib/src/components/Thumb/BuiltinThumbs/{Pill.js → Pill.tsx} +42 -33
  263. package/lib/src/components/Thumb/BuiltinThumbs/{Plus.js → Plus.tsx} +55 -44
  264. package/lib/src/components/Thumb/BuiltinThumbs/{Rect.js → Rect.tsx} +35 -17
  265. package/lib/src/components/Thumb/BuiltinThumbs/{Ring.js → Ring.tsx} +53 -43
  266. package/lib/src/components/Thumb/BuiltinThumbs/Solid.tsx +27 -0
  267. package/lib/src/components/Thumb/BuiltinThumbs/{TriangleDown.js → TriangleDown.tsx} +48 -29
  268. package/lib/src/components/Thumb/BuiltinThumbs/{TriangleUp.js → TriangleUp.tsx} +46 -27
  269. package/lib/src/components/Thumb/BuiltinThumbs/index.ts +27 -0
  270. package/lib/src/components/Thumb/{Thumb.js → Thumb.tsx} +100 -86
  271. package/lib/src/index.ts +31 -0
  272. package/lib/src/{styles.js → styles.ts} +136 -130
  273. package/lib/src/types.ts +455 -0
  274. package/lib/src/{utils.js → utils.tsx} +201 -164
  275. package/lib/typescript/AppContext.d.ts +4 -4
  276. package/lib/typescript/AppContext.d.ts.map +1 -8
  277. package/lib/typescript/ColorPicker.d.ts +5 -5
  278. package/lib/typescript/ColorPicker.d.ts.map +1 -8
  279. package/lib/typescript/colorKit/colorConversion/HEX.d.ts +12 -0
  280. package/lib/typescript/colorKit/colorConversion/HEX.d.ts.map +1 -0
  281. package/lib/typescript/colorKit/colorConversion/HSL.d.ts +18 -0
  282. package/lib/typescript/colorKit/colorConversion/HSL.d.ts.map +1 -0
  283. package/lib/typescript/colorKit/colorConversion/HSV.d.ts +18 -0
  284. package/lib/typescript/colorKit/colorConversion/HSV.d.ts.map +1 -0
  285. package/lib/typescript/colorKit/colorConversion/HWB.d.ts +18 -0
  286. package/lib/typescript/colorKit/colorConversion/HWB.d.ts.map +1 -0
  287. package/lib/typescript/colorKit/colorConversion/RGB.d.ts +18 -0
  288. package/lib/typescript/colorKit/colorConversion/RGB.d.ts.map +1 -0
  289. package/lib/typescript/colorKit/colorConversion/index.d.ts +12 -0
  290. package/lib/typescript/colorKit/colorConversion/index.d.ts.map +1 -0
  291. package/lib/typescript/colorKit/colorInformation.d.ts +36 -36
  292. package/lib/typescript/colorKit/colorInformation.d.ts.map +1 -8
  293. package/lib/typescript/colorKit/colorManipulation.d.ts +111 -111
  294. package/lib/typescript/colorKit/colorManipulation.d.ts.map +1 -8
  295. package/lib/typescript/colorKit/colorUtilities.d.ts +70 -70
  296. package/lib/typescript/colorKit/colorUtilities.d.ts.map +1 -8
  297. package/lib/typescript/colorKit/colorsRegex.d.ts +4 -4
  298. package/lib/typescript/colorKit/colorsRegex.d.ts.map +1 -8
  299. package/lib/typescript/colorKit/index.d.ts +114 -150
  300. package/lib/typescript/colorKit/index.d.ts.map +1 -8
  301. package/lib/typescript/colorKit/namedColors.d.ts +149 -149
  302. package/lib/typescript/colorKit/namedColors.d.ts.map +1 -8
  303. package/lib/typescript/colorKit/types.d.ts +45 -57
  304. package/lib/typescript/colorKit/types.d.ts.map +1 -8
  305. package/lib/typescript/colorKit/utilities.d.ts +12 -9
  306. package/lib/typescript/colorKit/utilities.d.ts.map +1 -8
  307. package/lib/typescript/components/InputWidget/InputWidget.d.ts +14 -14
  308. package/lib/typescript/components/InputWidget/InputWidget.d.ts.map +1 -8
  309. package/lib/typescript/components/InputWidget/Widgets/HexWidget.d.ts +14 -14
  310. package/lib/typescript/components/InputWidget/Widgets/HexWidget.d.ts.map +1 -8
  311. package/lib/typescript/components/InputWidget/Widgets/HslWidget.d.ts +15 -15
  312. package/lib/typescript/components/InputWidget/Widgets/HslWidget.d.ts.map +1 -8
  313. package/lib/typescript/components/InputWidget/Widgets/HsvWidget.d.ts +15 -15
  314. package/lib/typescript/components/InputWidget/Widgets/HsvWidget.d.ts.map +1 -8
  315. package/lib/typescript/components/InputWidget/Widgets/HwbWidget.d.ts +15 -15
  316. package/lib/typescript/components/InputWidget/Widgets/HwbWidget.d.ts.map +1 -8
  317. package/lib/typescript/components/InputWidget/Widgets/RgbWidget.d.ts +15 -15
  318. package/lib/typescript/components/InputWidget/Widgets/RgbWidget.d.ts.map +1 -8
  319. package/lib/typescript/components/InputWidget/Widgets/WidgetTextInput.d.ts +29 -29
  320. package/lib/typescript/components/InputWidget/Widgets/WidgetTextInput.d.ts.map +1 -8
  321. package/lib/typescript/components/Panels/Panel1.d.ts +16 -13
  322. package/lib/typescript/components/Panels/Panel1.d.ts.map +1 -8
  323. package/lib/typescript/components/Panels/Panel2.d.ts +20 -17
  324. package/lib/typescript/components/Panels/Panel2.d.ts.map +1 -8
  325. package/lib/typescript/components/Panels/Panel3.d.ts +18 -15
  326. package/lib/typescript/components/Panels/Panel3.d.ts.map +1 -8
  327. package/lib/typescript/components/Panels/Panel4.d.ts +18 -15
  328. package/lib/typescript/components/Panels/Panel4.d.ts.map +1 -8
  329. package/lib/typescript/components/Panels/Panel5.d.ts +7 -4
  330. package/lib/typescript/components/Panels/Panel5.d.ts.map +1 -8
  331. package/lib/typescript/components/Preview.d.ts +11 -11
  332. package/lib/typescript/components/Preview.d.ts.map +1 -8
  333. package/lib/typescript/components/PreviewText.d.ts +4 -4
  334. package/lib/typescript/components/PreviewText.d.ts.map +1 -8
  335. package/lib/typescript/components/Sliders/{BrightnessSlider.d.ts → HSB/BrightnessSlider.d.ts} +17 -17
  336. package/lib/typescript/components/Sliders/HSB/BrightnessSlider.d.ts.map +1 -0
  337. package/lib/typescript/components/Sliders/{HueSlider.d.ts → HSB/HueSlider.d.ts} +17 -17
  338. package/lib/typescript/components/Sliders/HSB/HueSlider.d.ts.map +1 -0
  339. package/lib/typescript/components/Sliders/{SaturationSlider.d.ts → HSB/SaturationSlider.d.ts} +17 -17
  340. package/lib/typescript/components/Sliders/HSB/SaturationSlider.d.ts.map +1 -0
  341. package/lib/typescript/components/Sliders/HueCircular.d.ts +16 -16
  342. package/lib/typescript/components/Sliders/HueCircular.d.ts.map +1 -8
  343. package/lib/typescript/components/Sliders/OpacitySlider.d.ts +17 -17
  344. package/lib/typescript/components/Sliders/OpacitySlider.d.ts.map +1 -8
  345. package/lib/typescript/components/Sliders/RGB/BlueSlider.d.ts +16 -16
  346. package/lib/typescript/components/Sliders/RGB/BlueSlider.d.ts.map +1 -8
  347. package/lib/typescript/components/Sliders/RGB/GreenSlider.d.ts +16 -16
  348. package/lib/typescript/components/Sliders/RGB/GreenSlider.d.ts.map +1 -8
  349. package/lib/typescript/components/Sliders/RGB/RedSlider.d.ts +16 -16
  350. package/lib/typescript/components/Sliders/RGB/RedSlider.d.ts.map +1 -8
  351. package/lib/typescript/components/Swatches.d.ts +4 -4
  352. package/lib/typescript/components/Swatches.d.ts.map +1 -8
  353. package/lib/typescript/components/Thumb/BuiltinThumbs/Circle.d.ts +13 -13
  354. package/lib/typescript/components/Thumb/BuiltinThumbs/Circle.d.ts.map +1 -8
  355. package/lib/typescript/components/Thumb/BuiltinThumbs/DoubleTriangle.d.ts +13 -13
  356. package/lib/typescript/components/Thumb/BuiltinThumbs/DoubleTriangle.d.ts.map +1 -8
  357. package/lib/typescript/components/Thumb/BuiltinThumbs/Hollow.d.ts +13 -13
  358. package/lib/typescript/components/Thumb/BuiltinThumbs/Hollow.d.ts.map +1 -8
  359. package/lib/typescript/components/Thumb/BuiltinThumbs/Line.d.ts +14 -14
  360. package/lib/typescript/components/Thumb/BuiltinThumbs/Line.d.ts.map +1 -8
  361. package/lib/typescript/components/Thumb/BuiltinThumbs/Pill.d.ts +14 -14
  362. package/lib/typescript/components/Thumb/BuiltinThumbs/Pill.d.ts.map +1 -8
  363. package/lib/typescript/components/Thumb/BuiltinThumbs/Plus.d.ts +14 -14
  364. package/lib/typescript/components/Thumb/BuiltinThumbs/Plus.d.ts.map +1 -8
  365. package/lib/typescript/components/Thumb/BuiltinThumbs/Rect.d.ts +13 -13
  366. package/lib/typescript/components/Thumb/BuiltinThumbs/Rect.d.ts.map +1 -8
  367. package/lib/typescript/components/Thumb/BuiltinThumbs/Ring.d.ts +14 -14
  368. package/lib/typescript/components/Thumb/BuiltinThumbs/Ring.d.ts.map +1 -8
  369. package/lib/typescript/components/Thumb/BuiltinThumbs/Solid.d.ts +12 -12
  370. package/lib/typescript/components/Thumb/BuiltinThumbs/Solid.d.ts.map +1 -8
  371. package/lib/typescript/components/Thumb/BuiltinThumbs/TriangleDown.d.ts +13 -13
  372. package/lib/typescript/components/Thumb/BuiltinThumbs/TriangleDown.d.ts.map +1 -8
  373. package/lib/typescript/components/Thumb/BuiltinThumbs/TriangleUp.d.ts +13 -13
  374. package/lib/typescript/components/Thumb/BuiltinThumbs/TriangleUp.d.ts.map +1 -8
  375. package/lib/typescript/components/Thumb/BuiltinThumbs/index.d.ts +26 -26
  376. package/lib/typescript/components/Thumb/BuiltinThumbs/index.d.ts.map +1 -8
  377. package/lib/typescript/components/Thumb/Thumb.d.ts +15 -15
  378. package/lib/typescript/components/Thumb/Thumb.d.ts.map +1 -8
  379. package/lib/typescript/index.d.ts +23 -23
  380. package/lib/typescript/index.d.ts.map +1 -8
  381. package/lib/typescript/styles.d.ts +142 -146
  382. package/lib/typescript/styles.d.ts.map +1 -8
  383. package/lib/typescript/types.d.ts +360 -360
  384. package/lib/typescript/types.d.ts.map +1 -8
  385. package/lib/typescript/utils.d.ts +69 -62
  386. package/lib/typescript/utils.d.ts.map +1 -8
  387. package/package.json +110 -109
  388. package/lib/commonjs/colorKit/colorConversion.js +0 -1007
  389. package/lib/commonjs/colorKit/colorConversion.js.map +0 -155
  390. package/lib/commonjs/components/Sliders/BrightnessSlider.js.map +0 -151
  391. package/lib/commonjs/components/Sliders/HueSlider.js.map +0 -157
  392. package/lib/commonjs/components/Sliders/SaturationSlider.js.map +0 -158
  393. package/lib/module/colorKit/colorConversion.js +0 -994
  394. package/lib/module/colorKit/colorConversion.js.map +0 -147
  395. package/lib/module/components/Sliders/BrightnessSlider.js.map +0 -124
  396. package/lib/module/components/Sliders/HueSlider.js.map +0 -129
  397. package/lib/module/components/Sliders/SaturationSlider.js.map +0 -130
  398. package/lib/src/colorKit/colorConversion.js +0 -857
  399. package/lib/src/colorKit/index.js +0 -6
  400. package/lib/src/colorKit/types.js +0 -1
  401. package/lib/src/colorKit/utilities.js +0 -31
  402. package/lib/src/components/Thumb/BuiltinThumbs/Circle.js +0 -18
  403. package/lib/src/components/Thumb/BuiltinThumbs/Solid.js +0 -8
  404. package/lib/src/components/Thumb/BuiltinThumbs/index.js +0 -25
  405. package/lib/src/index.js +0 -22
  406. package/lib/src/types.js +0 -1
  407. package/lib/typescript/colorKit/colorConversion.d.ts +0 -48
  408. package/lib/typescript/colorKit/colorConversion.d.ts.map +0 -8
  409. package/lib/typescript/components/Sliders/BrightnessSlider.d.ts.map +0 -8
  410. package/lib/typescript/components/Sliders/HueSlider.d.ts.map +0 -8
  411. package/lib/typescript/components/Sliders/SaturationSlider.d.ts.map +0 -8
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Ahmed Alabsi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Ahmed Alabsi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,79 +1,79 @@
1
- :red_circle: :green_circle: :large_blue_circle:
2
-
3
- # Reanimated Color Picker
4
-
5
- [![npm](https://img.shields.io/npm/v/reanimated-color-picker?style=for-the-badge)](https://www.npmjs.com/package/reanimated-color-picker)
6
- [![GitHub](https://img.shields.io/github/license/alabsi91/reanimated-color-picker?style=for-the-badge)](https://github.com/alabsi91/reanimated-color-picker/blob/main/LICENSE)
7
- [![GitHub issues](https://img.shields.io/github/issues/alabsi91/reanimated-color-picker?style=for-the-badge)](https://github.com/alabsi91/reanimated-color-picker/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
8
- ![Platform](https://img.shields.io/badge/Platform-IOS%20%7C%20Android%20%7C%20Expo%20%7C%20Web-informational?style=for-the-badge)
9
- ![Arch](https://img.shields.io/badge/React%20Native-Paper%20%7C%20New%20Architecture-informational?style=for-the-badge)
10
-
11
- ### - A Pure JavaScript Color Picker for React Native.
12
-
13
- ### - Highly customizable.
14
-
15
- ### - Supports IOS, Android, Expo, and Web platforms.
16
-
17
- ### - Supports right-to-left (RTL) layouts.
18
-
19
- ![Example_1](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_1.png)
20
- ![Example_7](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_7.png)
21
-
22
- ![Example_2](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_2.png)
23
- ![Example_3](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_3.png)
24
-
25
- ![Example_4](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_4.png)
26
- ![Example_5](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_5.png)
27
-
28
- ![Example_8](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_8.png)
29
- ![Example_9](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_9.png)
30
-
31
- ![Example_10](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_10.png)
32
- ![Example_11](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_11.png)
33
-
34
- ![Example_6](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_6.png)
35
- ![Example_12](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_12.png)
36
-
37
- # :small_blue_diamond:Prerequisites
38
-
39
- - Follow the installation instructions by using the links provided below.
40
-
41
- - [react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation) version `2.0.0` or higher.
42
-
43
- - [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation) version `2.0.0` or higher.
44
-
45
- - For `Expo` managed workflow version `44` or higher is required.
46
-
47
- # :small_blue_diamond:Installation
48
-
49
- > **Note**
50
- > First we need to install [react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation)(>=2.0.0) and [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation)(>=2.0.0),
51
-
52
- - Open a Terminal in the project root and run:
53
-
54
- ```
55
- npm i reanimated-color-picker
56
- ```
57
-
58
- # :small_blue_diamond:Fabric support
59
-
60
- - `react-native-gesture-handler` supports the new architecture since version `2.3.0`.
61
- - `react-native-reanimated` supports the new architecture since version `3.0.0`.
62
-
63
- # :small_blue_diamond:Usage
64
-
65
- ### [📖 View the documentation site 📖](https://alabsi91.github.io/reanimated-color-picker/)
66
-
67
- > Please check out my other library, [React Native Material You Colors](https://github.com/alabsi91/react-native-material-you-colors).
68
-
69
- # :small_blue_diamond:License
70
-
71
- - Reanimated Color Picker library is licensed under [**The MIT License.**](https://github.com/alabsi91/reanimated-color-picker/blob/main/LICENSE)
72
-
73
- # :small_blue_diamond: Sponsoring
74
-
75
- <a href="https://github.com/sponsors/alabsi91">
76
- <img align="right" width="160" alt="This library helped you? Consider sponsoring!" src=".github/funding-octocat.svg">
77
- </a>
78
-
79
- If you're integrating Reanimated Color Picker in a production app, consider [funding this project](https://github.com/sponsors/alabsi91) and <a href="mailto:alabsi91@gmail.com">contact me</a> .
1
+ :red_circle: :green_circle: :large_blue_circle:
2
+
3
+ # Reanimated Color Picker
4
+
5
+ [![npm](https://img.shields.io/npm/v/reanimated-color-picker?style=for-the-badge)](https://www.npmjs.com/package/reanimated-color-picker)
6
+ [![GitHub](https://img.shields.io/github/license/alabsi91/reanimated-color-picker?style=for-the-badge)](https://github.com/alabsi91/reanimated-color-picker/blob/main/LICENSE)
7
+ [![GitHub issues](https://img.shields.io/github/issues/alabsi91/reanimated-color-picker?style=for-the-badge)](https://github.com/alabsi91/reanimated-color-picker/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
8
+ ![Platform](https://img.shields.io/badge/Platform-IOS%20%7C%20Android%20%7C%20Expo%20%7C%20Web-informational?style=for-the-badge)
9
+ ![Arch](https://img.shields.io/badge/React%20Native-Paper%20%7C%20New%20Architecture-informational?style=for-the-badge)
10
+
11
+ ### - A Pure JavaScript Color Picker for React Native.
12
+
13
+ ### - Highly customizable.
14
+
15
+ ### - Supports IOS, Android, Expo, and Web platforms.
16
+
17
+ ### - Supports right-to-left (RTL) layouts.
18
+
19
+ ![Example_1](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_1.png)
20
+ ![Example_7](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_7.png)
21
+
22
+ ![Example_2](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_2.png)
23
+ ![Example_3](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_3.png)
24
+
25
+ ![Example_4](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_4.png)
26
+ ![Example_5](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_5.png)
27
+
28
+ ![Example_8](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_8.png)
29
+ ![Example_9](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_9.png)
30
+
31
+ ![Example_10](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_10.png)
32
+ ![Example_11](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_11.png)
33
+
34
+ ![Example_6](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_6.png)
35
+ ![Example_12](https://raw.githubusercontent.com/alabsi91/reanimated-color-picker/main/images/example_12.png)
36
+
37
+ # :small_blue_diamond:Prerequisites
38
+
39
+ - Follow the installation instructions by using the links provided below.
40
+
41
+ - [react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation) version `2.0.0` or higher.
42
+
43
+ - [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#installation) version `2.0.0` or higher.
44
+
45
+ - For `Expo` managed workflow version `44` or higher is required.
46
+
47
+ # :small_blue_diamond:Installation
48
+
49
+ > **Note**
50
+ > First we need to install [react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation)(>=2.0.0) and [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation)(>=2.0.0),
51
+
52
+ - Open a Terminal in the project root and run:
53
+
54
+ ```
55
+ npm i reanimated-color-picker
56
+ ```
57
+
58
+ # :small_blue_diamond:Fabric support
59
+
60
+ - `react-native-gesture-handler` supports the new architecture since version `2.3.0`.
61
+ - `react-native-reanimated` supports the new architecture since version `3.0.0`.
62
+
63
+ # :small_blue_diamond:Usage
64
+
65
+ ### [📖 View the documentation site 📖](https://alabsi91.github.io/reanimated-color-picker/)
66
+
67
+ > Please check out my other library, [React Native Material You Colors](https://github.com/alabsi91/react-native-material-you-colors).
68
+
69
+ # :small_blue_diamond:License
70
+
71
+ - Reanimated Color Picker library is licensed under [**The MIT License.**](https://github.com/alabsi91/reanimated-color-picker/blob/main/LICENSE)
72
+
73
+ # :small_blue_diamond: Sponsoring
74
+
75
+ <a href="https://github.com/sponsors/alabsi91">
76
+ <img align="right" width="160" alt="This library helped you? Consider sponsoring!" src=".github/funding-octocat.svg">
77
+ </a>
78
+
79
+ If you're integrating Reanimated Color Picker in a production app, consider [funding this project](https://github.com/sponsors/alabsi91) and <a href="mailto:alabsi91@gmail.com">contact me</a> .
@@ -1,22 +1 @@
1
- {
2
- "version": 3,
3
- "file": "AppContext.js",
4
- "names": [
5
- "_react",
6
- "require",
7
- "pickerContext",
8
- "createContext",
9
- "PickerContextProvider",
10
- "exports",
11
- "Provider",
12
- "usePickerContext",
13
- "ctx",
14
- "useContext",
15
- "Error"
16
- ],
17
- "sources": ["../../src/AppContext.ts"],
18
- "sourcesContent": [
19
- "import { createContext, useContext } from 'react';\r\n\r\nimport type { ColorPickerContext } from '@types';\r\n\r\nconst pickerContext = createContext<ColorPickerContext>(null!);\r\nexport const PickerContextProvider = pickerContext.Provider;\r\n\r\nexport default function usePickerContext() {\r\n const ctx = useContext(pickerContext);\r\n if (!ctx) {\r\n throw new Error('[reanimated-color-picker]: App context is not ready yet!');\r\n }\r\n return ctx;\r\n}\r\n"
20
- ],
21
- "mappings": ";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,MAAMC,aAAa,gBAAG,IAAAC,oBAAa,EAAqB,IAAK,CAAC;AACvD,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGF,aAAa,CAACI,QAAQ;AAE5C,SAASC,gBAAgBA,CAAA,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,iBAAU,EAACP,aAAa,CAAC;EACrC,IAAI,CAACM,GAAG,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,0DAA0D,CAAC;EAC7E;EACA,OAAOF,GAAG;AACZ"
22
- }
1
+ {"version":3,"file":"AppContext.js","names":["_react","require","pickerContext","createContext","PickerContextProvider","exports","Provider","usePickerContext","ctx","useContext","Error"],"sources":["../src/AppContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { ColorPickerContext } from './types';\n\nconst pickerContext = createContext<ColorPickerContext>(null!);\nexport const PickerContextProvider = pickerContext.Provider;\n\nexport default function usePickerContext() {\n const ctx = useContext(pickerContext);\n if (!ctx) {\n throw new Error('[reanimated-color-picker]: App context is not ready yet!');\n }\n return ctx;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,MAAMC,aAAa,gBAAG,IAAAC,oBAAa,EAAqB,IAAK,CAAC;AACvD,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGF,aAAa,CAACI,QAAQ;AAE5C,SAASC,gBAAgBA,CAAA,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,iBAAU,EAACP,aAAa,CAAC;EACrC,IAAI,CAACM,GAAG,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,0DAA0D,CAAC;EAC7E;EACA,OAAOF,GAAG;AACZ"}
@@ -8,7 +8,7 @@ var _react = _interopRequireWildcard(require('react'));
8
8
  var _reactNative = require('react-native');
9
9
  var _reactNativeGestureHandler = require('react-native-gesture-handler');
10
10
  var _reactNativeReanimated = require('react-native-reanimated');
11
- var _colorKit = _interopRequireDefault(require('./colorKit'));
11
+ var _index = _interopRequireDefault(require('./colorKit/index'));
12
12
  var _AppContext = require('./AppContext');
13
13
  var _utils = require('./utils');
14
14
  function _interopRequireDefault(obj) {
@@ -47,145 +47,148 @@ if (_utils.isWeb) {
47
47
  // ignore
48
48
  }
49
49
  }
50
- const ColorPicker = /*#__PURE__*/ (0, _react.forwardRef)((_ref, ref) => {
51
- let {
52
- adaptSpectrum = false,
53
- sliderThickness = 25,
54
- thumbAnimationDuration = 200,
55
- thumbSize = 35,
56
- thumbShape = 'ring',
57
- boundedThumb = false,
58
- thumbColor,
59
- renderThumb,
60
- thumbStyle,
61
- thumbInnerStyle,
62
- value = '#fff',
63
- onChange,
64
- onComplete,
65
- style = {},
66
- children = /*#__PURE__*/ _react.default.createElement(_reactNative.Text, null, 'NO CHILDREN'),
67
- } = _ref;
68
- const initialColor = (0, _react.useRef)(_colorKit.default.HSV(value).object()).current;
69
- // color's channels values.
70
- const hueValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.h);
71
- const saturationValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.s);
72
- const brightnessValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.v);
73
- const alphaValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.a);
74
- const returnedResults = color => {
75
- color = color ?? {
76
- h: hueValue.value,
77
- s: saturationValue.value,
78
- v: brightnessValue.value,
79
- a: alphaValue.value,
50
+ const ColorPicker = /*#__PURE__*/ (0, _react.forwardRef)(
51
+ (
52
+ {
53
+ adaptSpectrum = false,
54
+ sliderThickness = 25,
55
+ thumbAnimationDuration = 200,
56
+ thumbSize = 35,
57
+ thumbShape = 'ring',
58
+ boundedThumb = false,
59
+ thumbColor,
60
+ renderThumb,
61
+ thumbStyle,
62
+ thumbInnerStyle,
63
+ value = '#fff',
64
+ onChange,
65
+ onComplete,
66
+ style = {},
67
+ children = /*#__PURE__*/ _react.default.createElement(_reactNative.Text, null, 'NO CHILDREN'),
68
+ },
69
+ ref
70
+ ) => {
71
+ const initialColor = (0, _react.useRef)(_index.default.HSV(value).object()).current;
72
+ // color's channels values.
73
+ const hueValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.h);
74
+ const saturationValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.s);
75
+ const brightnessValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.v);
76
+ const alphaValue = (0, _reactNativeReanimated.useSharedValue)(initialColor.a);
77
+ const returnedResults = color => {
78
+ color = color ?? {
79
+ h: hueValue.value,
80
+ s: saturationValue.value,
81
+ v: brightnessValue.value,
82
+ a: alphaValue.value,
83
+ };
84
+ return {
85
+ hex: _index.default.HEX(color),
86
+ rgb: _index.default.RGB(color).string(false),
87
+ rgba: _index.default.RGB(color).string(true),
88
+ hsl: _index.default.HSL(color).string(false),
89
+ hsla: _index.default.HSL(color).string(true),
90
+ hsv: _index.default.HSV(color).string(false),
91
+ hsva: _index.default.HSV(color).string(true),
92
+ hwb: _index.default.HWB(color).string(false),
93
+ hwba: _index.default.HWB(color).string(true),
94
+ };
95
+ };
96
+ const onGestureEnd = color => {
97
+ onComplete === null || onComplete === void 0 || onComplete(returnedResults(color));
80
98
  };
81
- return {
82
- hex: _colorKit.default.HEX(color),
83
- rgb: _colorKit.default.RGB(color).string(false),
84
- rgba: _colorKit.default.RGB(color).string(true),
85
- hsl: _colorKit.default.HSL(color).string(false),
86
- hsla: _colorKit.default.HSL(color).string(true),
87
- hsv: _colorKit.default.HSV(color).string(false),
88
- hsva: _colorKit.default.HSV(color).string(true),
89
- hwb: _colorKit.default.HWB(color).string(false),
90
- hwba: _colorKit.default.HWB(color).string(true),
99
+ const onGestureChange = color => {
100
+ onChange === null || onChange === void 0 || onChange(returnedResults(color));
91
101
  };
92
- };
93
- const onGestureEnd = color => {
94
- onComplete === null || onComplete === void 0 || onComplete(returnedResults(color));
95
- };
96
- const onGestureChange = color => {
97
- onChange === null || onChange === void 0 || onChange(returnedResults(color));
98
- };
99
- const setColor = function (color) {
100
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : thumbAnimationDuration;
101
- const { h, s, v, a } = _colorKit.default.HSV(color).object();
102
- hueValue.value = (0, _reactNativeReanimated.withTiming)(h, {
103
- duration,
104
- });
105
- saturationValue.value = (0, _reactNativeReanimated.withTiming)(s, {
106
- duration,
107
- });
108
- brightnessValue.value = (0, _reactNativeReanimated.withTiming)(v, {
109
- duration,
110
- });
111
- alphaValue.value = (0, _reactNativeReanimated.withTiming)(a, {
112
- duration,
113
- });
114
- };
115
- (0, _react.useEffect)(() => {
116
- // Ignore value changes if the current color already matches the new color from the value props.
117
- const newColorFormat = _colorKit.default.getFormat(value);
118
- const currentColors = returnedResults();
102
+ const setColor = (color, duration = thumbAnimationDuration) => {
103
+ const { h, s, v, a } = _index.default.HSV(color).object();
104
+ hueValue.value = (0, _reactNativeReanimated.withTiming)(h, {
105
+ duration,
106
+ });
107
+ saturationValue.value = (0, _reactNativeReanimated.withTiming)(s, {
108
+ duration,
109
+ });
110
+ brightnessValue.value = (0, _reactNativeReanimated.withTiming)(v, {
111
+ duration,
112
+ });
113
+ alphaValue.value = (0, _reactNativeReanimated.withTiming)(a, {
114
+ duration,
115
+ });
116
+ };
117
+ (0, _react.useEffect)(() => {
118
+ // Ignore value changes if the current color already matches the new color from the value props.
119
+ const newColorFormat = _index.default.getFormat(value);
120
+ const currentColors = returnedResults();
119
121
 
120
- // null or named color E.g "red"
121
- if (!newColorFormat || newColorFormat === 'named') {
122
- setColor(value);
123
- return;
124
- }
122
+ // null or named color E.g "red"
123
+ if (!newColorFormat || newColorFormat === 'named') {
124
+ setColor(value);
125
+ return;
126
+ }
125
127
 
126
- // hex color
127
- if (newColorFormat === 'hex3' || newColorFormat === 'hex4' || newColorFormat === 'hex6' || newColorFormat === 'hex8') {
128
- if (value !== currentColors.hex) setColor(value);
129
- return;
130
- }
128
+ // hex color
129
+ if (newColorFormat === 'hex3' || newColorFormat === 'hex4' || newColorFormat === 'hex6' || newColorFormat === 'hex8') {
130
+ if (value !== currentColors.hex) setColor(value);
131
+ return;
132
+ }
131
133
 
132
- // hsl | hsla | rgb | rgba | hsva | hsv | hwba | hwb
133
- if (newColorFormat in currentColors) {
134
- if (value !== currentColors[newColorFormat]) setColor(value);
135
- return;
136
- }
137
- setColor(value);
138
- }, [value]);
134
+ // hsl | hsla | rgb | rgba | hsva | hsv | hwba | hwb
135
+ if (newColorFormat in currentColors) {
136
+ if (value !== currentColors[newColorFormat]) setColor(value);
137
+ return;
138
+ }
139
+ setColor(value);
140
+ }, [value]);
139
141
 
140
- // Addressing a sporadic problem where the shared value for color channels fails to update upon component mounting.
141
- // This issue appears to manifest randomly and might be correlated with the Reanimated library.
142
- (0, _react.useEffect)(() => {
143
- hueValue.value += 1;
144
- saturationValue.value += 1;
145
- brightnessValue.value += 1;
146
- setColor(value, 100);
147
- }, []);
148
- (0, _react.useImperativeHandle)(ref, () => ({
149
- setColor,
150
- }));
151
- const ctxValue = {
152
- hueValue,
153
- saturationValue,
154
- brightnessValue,
155
- alphaValue,
156
- adaptSpectrum,
157
- sliderThickness,
158
- thumbSize,
159
- thumbShape,
160
- boundedThumb,
161
- thumbColor,
162
- renderThumb,
163
- thumbStyle,
164
- thumbInnerStyle,
165
- value,
166
- setColor,
167
- returnedResults,
168
- onGestureEnd,
169
- onGestureChange,
170
- };
171
- return /*#__PURE__*/ _react.default.createElement(
172
- _reactNativeGestureHandler.GestureHandlerRootView,
173
- {
174
- style: [
175
- {
176
- direction: _utils.isWeb ? 'ltr' : undefined,
177
- },
178
- style,
179
- ],
180
- },
181
- /*#__PURE__*/ _react.default.createElement(
182
- _AppContext.PickerContextProvider,
142
+ // Addressing a sporadic problem where the shared value for color channels fails to update upon component mounting.
143
+ // This issue appears to manifest randomly and might be correlated with the Reanimated library.
144
+ (0, _react.useEffect)(() => {
145
+ hueValue.value += 1;
146
+ saturationValue.value += 1;
147
+ brightnessValue.value += 1;
148
+ setColor(value, 100);
149
+ }, []);
150
+ (0, _react.useImperativeHandle)(ref, () => ({
151
+ setColor,
152
+ }));
153
+ const ctxValue = {
154
+ hueValue,
155
+ saturationValue,
156
+ brightnessValue,
157
+ alphaValue,
158
+ adaptSpectrum,
159
+ sliderThickness,
160
+ thumbSize,
161
+ thumbShape,
162
+ boundedThumb,
163
+ thumbColor,
164
+ renderThumb,
165
+ thumbStyle,
166
+ thumbInnerStyle,
167
+ value,
168
+ setColor,
169
+ returnedResults,
170
+ onGestureEnd,
171
+ onGestureChange,
172
+ };
173
+ return /*#__PURE__*/ _react.default.createElement(
174
+ _reactNativeGestureHandler.GestureHandlerRootView,
183
175
  {
184
- value: ctxValue,
176
+ style: [
177
+ {
178
+ direction: _utils.isWeb ? 'ltr' : undefined,
179
+ },
180
+ style,
181
+ ],
185
182
  },
186
- children
187
- )
188
- );
189
- });
183
+ /*#__PURE__*/ _react.default.createElement(
184
+ _AppContext.PickerContextProvider,
185
+ {
186
+ value: ctxValue,
187
+ },
188
+ children
189
+ )
190
+ );
191
+ }
192
+ );
190
193
  var _default = (exports.default = ColorPicker);
191
194
  //# sourceMappingURL=ColorPicker.js.map