Flutter plugin to help you experiment with different Color Schemes without pain

Flutter plugin to help you experiment with different Color Schemes without pain

Flutter plugin to help you experiment with different Color Schemes without pain .Making a coherent Material Design theme is hard. This is a Flutter plugin that generates a random color pallet based on Material Design while respecting WCAG guidelines.

Random Color Scheme

Making a coherent Material Design theme is hard. This is a Flutter plugin that generates a random color pallet based on Material Design while respecting WCAG guidelines.

The idea is for you to (temporarily) replace your ColorScheme() with a randomColorSchemeLight() or randomColorSchemeDark(). On each run, hot refresh or hot restart, the app is going to look different. The theme is printed in terminal, so you can easily copy and paste back into your project with the colors that you want to stay.

The interactive sample allows you to see how it works and the reasoning behind:

Random Color Scheme

Usage

In the pubspec.yaml of your flutter project, add the following dependency:

pub package

dependencies:
  random_color_scheme: ^VERSION

In your project, just replace the ColorScheme.dark(...) with randomColorSchemeDark(). If you want a light theme, there is a randomColorSchemeLight().

import 'package:random_colorscheme/random_color_scheme.dart';

Theme(
  data: ThemeData(
    colorScheme: randomColorSchemeDark(),
  ),
  child: MyApp(),
)
How it works

This started in my Color Studio project. I started looking at the Material Design Guidelines on color for both light and dark theme. After extracting some colors (like the Primary, Secondary and Owl Study), I decided to see how similar were they, in what range are they and how they behave together. Then, I used HSLuv with a random number generator and rules detected from my observation. The final adjustments were made when tweaking the sample. HSLuv is great because only the Lightness attribute affects WCAG calculated contrast, so all themes are guaranteed to pass a minimum accessibility threshold.

Function listing
  • randomColorSchemeDark(seed: null | int): ColorScheme
  • randomColorSchemeLight(seed: null | int): ColorScheme
  • randomColorScheme(seed: null | int, isDark: bool): ColorScheme

Seed: an integer which guarantees the random function is always going to have the same output (i.e., the same ColorScheme). It is optional.

Reporting Issues

If you have any suggestions or feedback, issues and pull requests are welcome. You can report here.

Download Details:

Author: bernaferrari

Demo: https://bernaferrari.github.io/RandomColorScheme/#/

Source Code: https://github.com/bernaferrari/RandomColorScheme

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking Android and iOS applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).