rydmike / flex_color_scheme

A Flutter package to make and use beautiful color scheme based themes.
Other
947 stars 105 forks source link

Add enhanced enum functions to `FlexScheme` to get its associated data and colors #210

Open rydmike opened 11 months ago

rydmike commented 11 months ago

Add enhanced enum functions data and colors to the FlexScheme enum, that returns the predefined FlexSchemeData and FlexSchemeColor respectively, that are associated with a given enum value.

This can be done already using the FlexColor.schemes map, this is a convenience API to be able to use e.g. FlexColor.mango.data to get the predefined FlexSchemeData for the mango enum scheme and e.g. FlexColor.barossa.colors(Brightness.dark) to get the pre-defined dark colors used for the barossa scheme colors.

The idea and usefulness of this minor API convenience came up in this discussion here: https://github.com/rydmike/flex_color_scheme/discussions/204#discussioncomment-7363365