@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
14 lines (12 loc) • 654 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.semantic.danger : (cursorColor ?? theme.colors.brand.primary);
const computedPlaceholderColor = placeholderColor ?? theme.colors.typography.tertiary;
const computedLabelColor = isError ? theme.colors.semantic.danger : labelColor ?? theme.colors.typography.primary;
return {
computedCursorColor,
computedPlaceholderColor,
computedLabelColor
}
}
export default generateColors;