mchome / flutter_colorpicker

HSV(HSB)/HSL/RGB/Material color picker inspired by all the good design for your amazing flutter apps.
https://pub.dev/packages/flutter_colorpicker
MIT License
350 stars 203 forks source link

How can i get Label Color #53

Closed sooryaraj closed 2 years ago

sooryaraj commented 3 years ago

is there any way to get label color i got a foreground color problem.

tsinis commented 3 years ago

Hey @sooryaraj

It's not very clear from the description, but are you talking about something like background color vs text color readability? For example black text on dark grey color? If it's a case — this package provides the useWhiteForeground function for that. Which returns true if the background color is dark (so you may use white/light foreground), and false if the background color is light (in that case you should use dark colors in the foreground instead). You can also provide your own bias as a parameter there, please see it in action (in the example) here: https://github.com/mchome/flutter_colorpicker/blob/74d898eeabd0dae1e3df2fad805fed6db5cb8da6/example/lib/main.dart#L96-L98

If it's enough for your needs — please consider closing the issue. Thanks!