File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export { default as popoverOverflowModifiers } from "./utils/popoverOverflowModi
4141export * from "./utils/tgFormValues" ;
4242export { default as tgFormValues } from "./utils/tgFormValues" ;
4343export { default as withStore } from "./utils/withStore" ;
44+ export { default as determineBlackOrWhiteTextColor } from "./utils/determineBlackOrWhiteTextColor" ;
4445export {
4546 default as withTableParams ,
4647 useTableParams
Original file line number Diff line number Diff line change 11/* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
22import Color from "color" ;
33
4- export default c => ( Color ( c ) . isLight ( ) ? "#000000" : "#FFFFFF" ) ;
4+ export default function determineBlackOrWhiteTextColor ( c ) {
5+ try {
6+ return Color ( c ) . isLight ( ) ? "#000000" : "#FFFFFF" ;
7+ } catch ( e ) {
8+ console . error ( "Error in color parsing:" , e ) ;
9+ return "#000000" ; // Fallback to black if color parsing fails
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments