Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 740 Bytes

File metadata and controls

22 lines (17 loc) · 740 Bytes

Create a ColorScheme from your Logo

You can create a ColorScheme from an image using the .fromImageProvider constructor 🖌️

This constructor "extracts the dominant color" from your image and creates a ColorScheme with "harmnonious colors that meet contrast requirements for accessibility":

ColorScheme? colorScheme;

  void setColorScheme(ColorScheme val) {
    setState(() => colorScheme = val);
  }

  @override
  void initState() {
    super.initState();
    ColorScheme.fromImageProvider(provider: const AssetImage('assets/logo.jpeg')).then((value) {
      setColorScheme(value);
    });
  }

Logo ColorScheme