UNPKG

691 BSource Map (JSON)View Raw
1{"version":3,"sources":["getContrastingColor.tsx"],"names":["color","getContrastingColor","input","light","dark","isLight"],"mappings":"AACA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,eAAe,SAASC,mBAAT,CACbC,KADa,EAEbC,KAFa,EAGbC,IAHa,EAIL;AACR,MAAI,OAAOF,KAAP,KAAiB,QAArB,EAA+B;AAC7B,WAAOF,KAAK,CAACE,KAAD,CAAL,CAAaG,OAAb,KAAyBD,IAAzB,GAAgCD,KAAvC;AACD;;AAED,SAAOA,KAAP;AACD","sourcesContent":["import type { ColorValue } from 'react-native';\nimport color from 'color';\n\nexport default function getContrastingColor(\n input: ColorValue,\n light: string,\n dark: string\n): string {\n if (typeof input === 'string') {\n return color(input).isLight() ? dark : light;\n }\n\n return light;\n}\n"]}
\No newline at end of file