@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
14 lines (12 loc) • 636 B
text/typescript
import type { ThemeTypes } from "../../types";
const generateColors = (theme: ThemeTypes, isError: boolean, cursorColor?: string, placeholderColor?: string, labelColor?: string) => {
const computedCursorColor = isError ? theme.colors.error : (cursorColor ?? theme.colors.cursorColor);
const computedPlaceholderColor = placeholderColor ?? theme.colors.placeholderColor;
const computedLabelColor = isError ? theme.colors.error : labelColor ?? theme.colors.textTertiary;
return {
computedCursorColor,
computedPlaceholderColor,
computedLabelColor
}
}
export default generateColors;