├── .github └── workflows │ └── main.yml ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets ├── github_large_preview.png ├── readme.png ├── sample_preview.png └── try_here.png ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ └── ic_launcher.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── color_output.dart │ ├── main.dart │ └── preview │ │ ├── chat_preview.dart │ │ └── social_preview.dart ├── pubspec.lock ├── pubspec.yaml └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── lib └── random_color_scheme.dart ├── pubspec.lock ├── pubspec.yaml └── test └── random_color_scheme_test.dart /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: subosito/flutter-action@v1.4.0 12 | with: 13 | channel: beta 14 | - run: flutter config --enable-web 15 | - run: flutter pub get 16 | - run: flutter test 17 | - run: | 18 | cd example/ 19 | flutter pub get 20 | flutter build web --release 21 | git clone --single-branch "https://${{ secrets.PAT }}@github.com/bernaferrari/bernaferrari.github.io.git" "clone_dir" 22 | rm -rf clone_dir/RandomColorScheme 23 | cp -r build/web clone_dir/RandomColorScheme 24 | cd clone_dir 25 | git config user.name github-actions 26 | git config user.email github-actions@github.com 27 | git add * 28 | git commit -m "generate RandomColorScheme" 29 | git push 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: d1178ae73b0a38c7e0f88416674a060c78d31849 8 | channel: master 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.1.4] - 03/03/2023. 2 | 3 | * Update API. 4 | * primaryVariant -> primaryContainer. 5 | * secondaryVariant -> secondaryContainer. 6 | 7 | ## [0.1.3] - 03/03/2021. 8 | 9 | * Add secondaryVariant. 10 | 11 | ## [0.1.1] - 23/02/2021. 12 | 13 | * Update package description and README images to work in pub.dev. 14 | 15 | ## [0.1.0] - 23/02/2021. 16 | 17 | * Add null-safety. 18 | 19 | ## [0.0.1] - 04/10/2020. 20 | * Initial release. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Bernardo Ferrari 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Image of Random Color Scheme](https://github.com/bernaferrari/RandomColorScheme/raw/main/assets/readme.png) 2 | 3 | # Random Color Scheme 4 | 5 | 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. 6 | 7 | The idea is for you to (temporarily) replace your `ColorScheme()` with a `randomColorSchemeLight()` or `randomColorSchemeDark()`. 8 | 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. 9 | 10 | The interactive sample allows you to see how it works and the reasoning behind: 11 | 12 | 13 | 14 | [![Random Color Scheme](https://github.com/bernaferrari/RandomColorScheme/raw/main/assets/sample_preview.png)](https://bernaferrari.github.io/RandomColorScheme/) 15 | 16 | ## Usage 17 | 18 | In the `pubspec.yaml` of your flutter project, add the following dependency: 19 | 20 | [![pub package](https://img.shields.io/pub/v/random_color_scheme.svg)](https://pub.dev/packages/random_color_scheme) 21 | 22 | ```yaml 23 | dependencies: 24 | random_color_scheme: ^VERSION 25 | ``` 26 | 27 | In your project, just replace the `ColorScheme.dark(...)` with `randomColorSchemeDark()`. 28 | If you want a light theme, there is a `randomColorSchemeLight()`. 29 | 30 | ```dart 31 | import 'package:random_colorscheme/random_color_scheme.dart'; 32 | 33 | Theme( 34 | data: ThemeData( 35 | colorScheme: randomColorSchemeDark(), 36 | ), 37 | child: MyApp(), 38 | ) 39 | ``` 40 | #### How it works 41 | This started in my [Color Studio project](https://github.com/bernaferrari/color-studio). 42 | I started looking at the Material Design Guidelines on color for both light and dark theme. 43 | 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. 44 | Then, I used [HSLuv](https://www.hsluv.org/) with a random number generator and rules detected from my observation. The final adjustments were made when tweaking the sample. 45 | HSLuv is great because only the Lightness attribute affects WCAG calculated contrast, so all themes are guaranteed to pass 46 | a minimum accessibility threshold. 47 | 48 | #### Function listing 49 | - `randomColorSchemeDark(seed: null | int): ColorScheme` 50 | - `randomColorSchemeLight(seed: null | int): ColorScheme` 51 | - `randomColorScheme(seed: null | int, isDark: bool): ColorScheme` 52 | 53 | Seed: an integer which guarantees the random function is always going to have the same output (i.e., the same ColorScheme). 54 | It is optional. 55 | 56 | ## Reporting Issues 57 | 58 | If you have any suggestions or feedback, issues and pull requests are welcome. 59 | You can report [here](https://github.com/bernaferrari/RandomColorScheme/issues). 60 | 61 | ## License 62 | 63 | Copyright 2020 Bernardo Ferrari 64 | 65 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 66 | 67 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 68 | 69 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /assets/github_large_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/assets/github_large_preview.png -------------------------------------------------------------------------------- /assets/readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/assets/readme.png -------------------------------------------------------------------------------- /assets/sample_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/assets/sample_preview.png -------------------------------------------------------------------------------- /assets/try_here.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/assets/try_here.png -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: d1178ae73b0a38c7e0f88416674a060c78d31849 8 | channel: master 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Random Color Scheme Sample 2 | 3 | This is the sample for the Random Color Scheme library. Check the full documentation [here](https://github.com/bernaferrari/RandomColorScheme). 4 | 5 | 6 | 7 | [![Random Color Scheme](../assets/sample_preview.png)](https://bernaferrari.github.io/RandomColorScheme/) 8 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | avoid_print: false # Uncomment to disable the `avoid_print` rule 6 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 7 | 8 | # Additional information about this file can be found at 9 | # https://dart.dev/guides/language/analysis-options 10 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 29 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.example" 42 | minSdkVersion 16 43 | targetSdkVersion 29 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/color_output.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:hsluv/hsluvcolor.dart'; 5 | 6 | class ColorOutput extends StatefulWidget { 7 | const ColorOutput({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _ColorOutputState(); 11 | } 12 | 13 | class _ColorOutputState extends State { 14 | late int currentSegment = PageStorage.of(context) 15 | .readState(context, identifier: const ValueKey("Selectable")) ?? 16 | 0; 17 | 18 | final Map children = const { 19 | 0: Text("HEX"), 20 | 1: Text("RGB"), 21 | 2: Text("HSLuv"), 22 | 3: Text("HSV"), 23 | }; 24 | 25 | void copyToClipboard(BuildContext context, String text) { 26 | Clipboard.setData(ClipboardData(text: text)); 27 | 28 | ScaffoldMessenger.of(context).hideCurrentSnackBar(); 29 | final snackBar = SnackBar( 30 | content: Text('$text copied'), 31 | duration: const Duration(milliseconds: 1000), 32 | ); 33 | ScaffoldMessenger.of(context).showSnackBar(snackBar); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | final surface = Theme.of(context).colorScheme.surface; 39 | final background = Theme.of(context).colorScheme.background; 40 | 41 | final lum = HSLuvColor.fromColor(background).lightness; 42 | 43 | final arr = [ 44 | Theme.of(context).colorScheme.primary, 45 | Theme.of(context).colorScheme.secondary, 46 | Theme.of(context).colorScheme.surface, 47 | Theme.of(context).colorScheme.background, 48 | ]; 49 | 50 | return Padding( 51 | padding: const EdgeInsets.all(8.0), 52 | child: Column( 53 | crossAxisAlignment: CrossAxisAlignment.stretch, 54 | mainAxisAlignment: MainAxisAlignment.center, 55 | children: [ 56 | CupertinoSlidingSegmentedControl( 57 | children: children, 58 | backgroundColor: 59 | Theme.of(context).colorScheme.onBackground.withOpacity(0.20), 60 | thumbColor: surface, 61 | onValueChanged: onValueChanged, 62 | groupValue: currentSegment, 63 | ), 64 | const SizedBox(height: 8.0), 65 | for (int i = 0; i < arr.length; i++) 66 | Padding( 67 | padding: const EdgeInsets.symmetric(vertical: 4.0), 68 | child: OutlinedButton( 69 | style: OutlinedButton.styleFrom( 70 | foregroundColor: arr[i], 71 | padding: const EdgeInsets.all(16.0), 72 | side: BorderSide(color: arr[i], width: 2.0), 73 | ), 74 | child: Text( 75 | arr[i].retrieveColorStr(currentSegment), 76 | style: TextStyle( 77 | color: lum > 50 ? Colors.black : Colors.white, 78 | ), 79 | ), 80 | onPressed: () { 81 | copyToClipboard( 82 | context, 83 | arr[i].retrieveColorStr(currentSegment), 84 | ); 85 | }, 86 | ), 87 | ), 88 | ], 89 | ), 90 | ); 91 | } 92 | 93 | void onValueChanged(int? newValue) { 94 | if (newValue == null) { 95 | return; 96 | } 97 | 98 | setState(() { 99 | currentSegment = newValue; 100 | PageStorage.of(context).writeState(context, currentSegment, 101 | identifier: const ValueKey("Selectable")); 102 | }); 103 | } 104 | } 105 | 106 | extension on Color { 107 | String retrieveColorStr(int kind) { 108 | switch (kind) { 109 | case 0: 110 | return "#${value.toRadixString(16).substring(2)}"; 111 | case 1: 112 | return "R:$red G:$green B:$blue"; 113 | case 2: 114 | final hsluv = HSLuvColor.fromColor(this); 115 | return "H:${hsluv.hue.round()} S:${hsluv.saturation.round()} L:${hsluv.lightness.round()}"; 116 | case 3: 117 | final hsv = HSVColor.fromColor(this); 118 | return "H:${hsv.hue.round()} S:${(hsv.saturation * 100).round()} V:${(hsv.value * 100).round()}"; 119 | default: 120 | return "error!"; 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:random_color_scheme/random_color_scheme.dart'; 3 | import 'package:url_launcher/url_launcher_string.dart'; 4 | 5 | import 'preview/chat_preview.dart'; 6 | import 'preview/social_preview.dart'; 7 | 8 | void main() { 9 | runApp(const MyApp()); 10 | } 11 | 12 | class MyApp extends StatelessWidget { 13 | const MyApp({Key? key}) : super(key: key); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return const MaterialApp( 18 | title: 'Random Color Scheme', 19 | home: RefreshableHome(), 20 | ); 21 | } 22 | } 23 | 24 | class RefreshableHome extends StatefulWidget { 25 | const RefreshableHome({Key? key}) : super(key: key); 26 | 27 | @override 28 | State createState() => _RefreshableHomeState(); 29 | } 30 | 31 | class _RefreshableHomeState extends State { 32 | int refreshSeed = 0; 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Scaffold( 37 | body: ThemeList(refreshSeed), 38 | appBar: AppBar( 39 | backgroundColor: Colors.white, 40 | title: const Text( 41 | "Random Color Scheme", 42 | style: TextStyle(color: Colors.black), 43 | ), 44 | actions: [ 45 | IconButton( 46 | icon: const Icon( 47 | Icons.code_rounded, 48 | color: Colors.black, 49 | ), 50 | tooltip: "Source", 51 | onPressed: () async { 52 | await launchUrlString( 53 | "https://github.com/bernaferrari/RandomColorScheme"); 54 | }, 55 | ) 56 | ], 57 | elevation: 0, 58 | ), 59 | floatingActionButton: FloatingActionButton.extended( 60 | onPressed: () { 61 | setState(() { 62 | refreshSeed += 25; 63 | }); 64 | }, 65 | label: const Text("Refresh"), 66 | icon: const Icon(Icons.refresh), 67 | backgroundColor: Colors.red[500], 68 | ), 69 | ); 70 | } 71 | } 72 | 73 | class ThemeList extends StatelessWidget { 74 | final int refresh; 75 | 76 | const ThemeList(this.refresh, {Key? key}) : super(key: key); 77 | 78 | Theme customTheme({Widget? child, required int i, required bool isDark}) { 79 | return Theme( 80 | data: ThemeData( 81 | colorScheme: randomColorScheme(seed: i + refresh, isDark: isDark), 82 | outlinedButtonTheme: OutlinedButtonThemeData( 83 | style: OutlinedButton.styleFrom( 84 | shape: RoundedRectangleBorder( 85 | borderRadius: BorderRadius.circular(8), 86 | ), 87 | ), 88 | ), 89 | cardTheme: CardTheme( 90 | elevation: 0, 91 | shape: RoundedRectangleBorder( 92 | borderRadius: BorderRadius.circular(8), 93 | ), 94 | ), 95 | ), 96 | child: const ThemeItem(), 97 | ); 98 | } 99 | 100 | @override 101 | Widget build(BuildContext context) { 102 | final condition = MediaQuery.of(context).size.width > 950; 103 | 104 | return Padding( 105 | padding: const EdgeInsets.all(4), 106 | child: ListView( 107 | children: [ 108 | Card( 109 | elevation: 0, 110 | color: const Color(0xffECFDF5), 111 | shape: RoundedRectangleBorder( 112 | side: const BorderSide(width: 2, color: Color(0xffA7F3D0)), 113 | borderRadius: BorderRadius.circular(8), 114 | ), 115 | child: Padding( 116 | padding: const EdgeInsets.all(16), 117 | child: Text( 118 | """ 119 | This is the sample for a library. 120 | The idea is for you to plug randomColorScheme() into your apps and discover new material themes.""", 121 | style: Theme.of(context).textTheme.titleSmall, 122 | textAlign: TextAlign.center, 123 | ), 124 | ), 125 | ), 126 | for (int i = 0; i < 25; i++) 127 | Flex( 128 | direction: condition ? Axis.horizontal : Axis.vertical, 129 | children: [ 130 | Flexible( 131 | flex: condition ? 1 : 0, 132 | child: customTheme( 133 | child: const ThemeItem(), 134 | i: i, 135 | isDark: true, 136 | ), 137 | ), 138 | Flexible( 139 | flex: condition ? 1 : 0, 140 | child: customTheme( 141 | child: const ThemeItem(), 142 | i: i, 143 | isDark: false, 144 | ), 145 | ), 146 | ], 147 | ), 148 | ], 149 | ), 150 | ); 151 | } 152 | } 153 | 154 | class ThemeItem extends StatelessWidget { 155 | const ThemeItem({Key? key}) : super(key: key); 156 | 157 | @override 158 | Widget build(BuildContext context) { 159 | return Card( 160 | color: Theme.of(context).colorScheme.background, 161 | elevation: 0, 162 | child: Row( 163 | children: const [ 164 | Expanded(child: SocialPreview()), 165 | Expanded(child: ChatPreview()), 166 | ], 167 | ), 168 | ); 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /example/lib/preview/chat_preview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChatPreview extends StatelessWidget { 4 | const ChatPreview({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | final primary = Theme.of(context).colorScheme.primary; 9 | 10 | return Column( 11 | children: [ 12 | const SizedBox(height: 8), 13 | Text( 14 | "Chat", 15 | style: TextStyle( 16 | color: primary, fontSize: 22, fontWeight: FontWeight.w800), 17 | ), 18 | Text( 19 | "14 participants", 20 | style: TextStyle( 21 | color: primary, fontSize: 14, fontWeight: FontWeight.w700), 22 | ), 23 | // ListTile( 24 | // title: Text("Bernardo"), 25 | // subtitle: Text("What's new?"), 26 | // leading: Padding( 27 | // padding: const EdgeInsets.all(8), 28 | // child: Icon( 29 | // Icons.accessibility_new_rounded, 30 | // size: 24, 31 | // color: primary, 32 | // ), 33 | // ), 34 | // trailing: Icon( 35 | // Icons.done, 36 | // size: 16, 37 | // color: primary, 38 | // ), 39 | // ), 40 | ListTile( 41 | title: const Text("Alfred"), 42 | subtitle: const Text( 43 | "Here is the weather for today", 44 | overflow: TextOverflow.ellipsis, 45 | ), 46 | leading: Padding( 47 | padding: const EdgeInsets.all(8), 48 | child: Icon( 49 | Icons.wb_sunny_outlined, 50 | size: 24, 51 | color: primary, 52 | ), 53 | ), 54 | trailing: Icon( 55 | Icons.done, 56 | size: 16, 57 | color: primary, 58 | ), 59 | ), 60 | Row( 61 | mainAxisAlignment: MainAxisAlignment.center, 62 | children: [ 63 | Icon( 64 | Icons.graphic_eq, 65 | color: primary, 66 | ), 67 | const SizedBox(width: 8), 68 | Icon( 69 | Icons.graphic_eq, 70 | color: Theme.of(context).colorScheme.secondary, 71 | ), 72 | ], 73 | ), 74 | ], 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /example/lib/preview/social_preview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../color_output.dart'; 4 | 5 | class SocialPreview extends StatelessWidget { 6 | const SocialPreview({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Card( 11 | margin: const EdgeInsets.all(8), 12 | clipBehavior: Clip.antiAlias, 13 | color: Theme.of(context).colorScheme.surface, 14 | child: Column( 15 | crossAxisAlignment: CrossAxisAlignment.stretch, 16 | children: [ 17 | Padding( 18 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), 19 | child: Text( 20 | "What's happening", 21 | style: Theme.of(context) 22 | .textTheme 23 | .titleLarge 24 | ?.copyWith(fontWeight: FontWeight.w900), 25 | ), 26 | ), 27 | Container( 28 | color: Theme.of(context).colorScheme.onSurface.withOpacity(0.24), 29 | height: 1, 30 | ), 31 | ListTile( 32 | title: const Text( 33 | "Trending", 34 | overflow: TextOverflow.ellipsis, 35 | ), 36 | subtitle: const Text( 37 | "Design updates", 38 | overflow: TextOverflow.ellipsis, 39 | ), 40 | contentPadding: const EdgeInsets.symmetric(horizontal: 8), 41 | leading: Padding( 42 | padding: const EdgeInsets.all(8), 43 | child: Icon( 44 | Icons.account_balance, 45 | size: 24, 46 | color: Theme.of(context).colorScheme.primary, 47 | ), 48 | ), 49 | trailing: Padding( 50 | padding: const EdgeInsets.only(right: 8), 51 | child: ElevatedButton.icon( 52 | style: ElevatedButton.styleFrom( 53 | padding: const EdgeInsets.all(16), 54 | elevation: 0, 55 | shape: RoundedRectangleBorder( 56 | borderRadius: BorderRadius.circular(8), 57 | ), 58 | ), 59 | icon: const Icon(Icons.share_outlined), 60 | label: Text( 61 | "Export", 62 | style: Theme.of(context).textTheme.bodyLarge?.copyWith( 63 | color: Theme.of(context).colorScheme.onPrimary, 64 | ), 65 | ), 66 | onPressed: () { 67 | showDialog( 68 | context: context, 69 | builder: (BuildContext context) { 70 | return SimpleDialog( 71 | title: const Text('Export (click to copy)'), 72 | titlePadding: const EdgeInsets.only(left: 16, top: 16), 73 | backgroundColor: 74 | Theme.of(context).brightness == Brightness.dark 75 | ? const Color(0xff080808) 76 | : Colors.white, 77 | contentPadding: const EdgeInsets.all(8), 78 | children: const [ColorOutput()], 79 | ); 80 | }, 81 | ); 82 | }, 83 | ), 84 | ), 85 | ), 86 | Container( 87 | color: Theme.of(context).colorScheme.onSurface.withOpacity(0.24), 88 | height: 1, 89 | ), 90 | Padding( 91 | padding: const EdgeInsets.symmetric(vertical: 8), 92 | child: Row( 93 | mainAxisAlignment: MainAxisAlignment.center, 94 | children: [ 95 | _NotButton("Primary", Theme.of(context).colorScheme.primary), 96 | const SizedBox(width: 8), 97 | _NotButton( 98 | "Secondary", 99 | Theme.of(context).colorScheme.secondary, 100 | ), 101 | ], 102 | ), 103 | ), 104 | ], 105 | ), 106 | ); 107 | } 108 | } 109 | 110 | class _NotButton extends StatelessWidget { 111 | final String text; 112 | final Color color; 113 | 114 | const _NotButton(this.text, this.color); 115 | 116 | @override 117 | Widget build(BuildContext context) { 118 | return Material( 119 | elevation: 0, 120 | color: Colors.transparent, 121 | shape: RoundedRectangleBorder( 122 | side: BorderSide(color: color), 123 | borderRadius: BorderRadius.circular(8), 124 | ), 125 | child: Padding( 126 | padding: const EdgeInsets.all(8), 127 | child: Row( 128 | children: [ 129 | Icon( 130 | Icons.border_inner, 131 | color: color, 132 | size: 16, 133 | ), 134 | const SizedBox(width: 8), 135 | Text( 136 | text, 137 | style: Theme.of(context) 138 | .textTheme 139 | .bodyMedium 140 | ?.copyWith(color: color), 141 | overflow: TextOverflow.ellipsis, 142 | ), 143 | ], 144 | ), 145 | ), 146 | ); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_lints: 58 | dependency: "direct dev" 59 | description: 60 | name: flutter_lints 61 | sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 62 | url: "https://pub.dev" 63 | source: hosted 64 | version: "2.0.1" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | flutter_web_plugins: 71 | dependency: transitive 72 | description: flutter 73 | source: sdk 74 | version: "0.0.0" 75 | hsluv: 76 | dependency: "direct main" 77 | description: 78 | name: hsluv 79 | sha256: "0b08f74edf7c788eb430e70e01e91360a4cbf1e5f6f2bf6e737e9beb26d15ce9" 80 | url: "https://pub.dev" 81 | source: hosted 82 | version: "1.1.2" 83 | js: 84 | dependency: transitive 85 | description: 86 | name: js 87 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 88 | url: "https://pub.dev" 89 | source: hosted 90 | version: "0.6.5" 91 | lints: 92 | dependency: transitive 93 | description: 94 | name: lints 95 | sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" 96 | url: "https://pub.dev" 97 | source: hosted 98 | version: "2.0.1" 99 | matcher: 100 | dependency: transitive 101 | description: 102 | name: matcher 103 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 104 | url: "https://pub.dev" 105 | source: hosted 106 | version: "0.12.13" 107 | material_color_utilities: 108 | dependency: transitive 109 | description: 110 | name: material_color_utilities 111 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 112 | url: "https://pub.dev" 113 | source: hosted 114 | version: "0.2.0" 115 | meta: 116 | dependency: transitive 117 | description: 118 | name: meta 119 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 120 | url: "https://pub.dev" 121 | source: hosted 122 | version: "1.8.0" 123 | path: 124 | dependency: transitive 125 | description: 126 | name: path 127 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "1.8.2" 131 | plugin_platform_interface: 132 | dependency: transitive 133 | description: 134 | name: plugin_platform_interface 135 | sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "2.1.4" 139 | random_color_scheme: 140 | dependency: "direct main" 141 | description: 142 | path: ".." 143 | relative: true 144 | source: path 145 | version: "0.1.4" 146 | sky_engine: 147 | dependency: transitive 148 | description: flutter 149 | source: sdk 150 | version: "0.0.99" 151 | source_span: 152 | dependency: transitive 153 | description: 154 | name: source_span 155 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 156 | url: "https://pub.dev" 157 | source: hosted 158 | version: "1.9.1" 159 | stack_trace: 160 | dependency: transitive 161 | description: 162 | name: stack_trace 163 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 164 | url: "https://pub.dev" 165 | source: hosted 166 | version: "1.11.0" 167 | stream_channel: 168 | dependency: transitive 169 | description: 170 | name: stream_channel 171 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 172 | url: "https://pub.dev" 173 | source: hosted 174 | version: "2.1.1" 175 | string_scanner: 176 | dependency: transitive 177 | description: 178 | name: string_scanner 179 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 180 | url: "https://pub.dev" 181 | source: hosted 182 | version: "1.2.0" 183 | term_glyph: 184 | dependency: transitive 185 | description: 186 | name: term_glyph 187 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 188 | url: "https://pub.dev" 189 | source: hosted 190 | version: "1.2.1" 191 | test_api: 192 | dependency: transitive 193 | description: 194 | name: test_api 195 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 196 | url: "https://pub.dev" 197 | source: hosted 198 | version: "0.4.16" 199 | url_launcher: 200 | dependency: "direct main" 201 | description: 202 | name: url_launcher 203 | sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e" 204 | url: "https://pub.dev" 205 | source: hosted 206 | version: "6.1.10" 207 | url_launcher_android: 208 | dependency: transitive 209 | description: 210 | name: url_launcher_android 211 | sha256: "1f4d9ebe86f333c15d318f81dcdc08b01d45da44af74552608455ebdc08d9732" 212 | url: "https://pub.dev" 213 | source: hosted 214 | version: "6.0.24" 215 | url_launcher_ios: 216 | dependency: transitive 217 | description: 218 | name: url_launcher_ios 219 | sha256: c9cd648d2f7ab56968e049d4e9116f96a85517f1dd806b96a86ea1018a3a82e5 220 | url: "https://pub.dev" 221 | source: hosted 222 | version: "6.1.1" 223 | url_launcher_linux: 224 | dependency: transitive 225 | description: 226 | name: url_launcher_linux 227 | sha256: e29039160ab3730e42f3d811dc2a6d5f2864b90a70fb765ea60144b03307f682 228 | url: "https://pub.dev" 229 | source: hosted 230 | version: "3.0.3" 231 | url_launcher_macos: 232 | dependency: transitive 233 | description: 234 | name: url_launcher_macos 235 | sha256: "2dddb3291a57b074dade66b5e07e64401dd2487caefd4e9e2f467138d8c7eb06" 236 | url: "https://pub.dev" 237 | source: hosted 238 | version: "3.0.3" 239 | url_launcher_platform_interface: 240 | dependency: transitive 241 | description: 242 | name: url_launcher_platform_interface 243 | sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" 244 | url: "https://pub.dev" 245 | source: hosted 246 | version: "2.1.2" 247 | url_launcher_web: 248 | dependency: transitive 249 | description: 250 | name: url_launcher_web 251 | sha256: "574cfbe2390666003c3a1d129bdc4574aaa6728f0c00a4829a81c316de69dd9b" 252 | url: "https://pub.dev" 253 | source: hosted 254 | version: "2.0.15" 255 | url_launcher_windows: 256 | dependency: transitive 257 | description: 258 | name: url_launcher_windows 259 | sha256: "97c9067950a0d09cbd93e2e3f0383d1403989362b97102fbf446473a48079a4b" 260 | url: "https://pub.dev" 261 | source: hosted 262 | version: "3.0.4" 263 | vector_math: 264 | dependency: transitive 265 | description: 266 | name: vector_math 267 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 268 | url: "https://pub.dev" 269 | source: hosted 270 | version: "2.1.4" 271 | sdks: 272 | dart: ">=2.19.0 <3.0.0" 273 | flutter: ">=3.3.0" 274 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Example for Random Color Scheme. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | version: 1.0.1 8 | 9 | environment: 10 | sdk: '>=2.19.0 <4.0.0' 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | 16 | url_launcher: ^6.1.10 17 | hsluv: ^1.1.2 18 | random_color_scheme: 19 | path: ../ 20 | 21 | dev_dependencies: 22 | flutter_lints: ^2.0.1 23 | flutter_test: 24 | sdk: flutter 25 | 26 | flutter: 27 | uses-material-design: true -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bernaferrari/RandomColorScheme/078d5eeb338a58de00d9ad25aca9dd5348314a64/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | example 18 | 19 | 20 | 21 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/random_color_scheme.dart: -------------------------------------------------------------------------------- 1 | library random_color_scheme; 2 | 3 | import 'dart:math' as math; 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:hsluv/hsluvcolor.dart'; 7 | 8 | const _kPrimary = 'primary'; 9 | const _kPrimaryContainer = 'primaryContainer'; 10 | const _kSecondary = 'secondary'; 11 | const _kSecondaryContainer = 'secondaryContainer'; 12 | const _kSurface = 'surface'; 13 | const _kBackground = 'background'; 14 | 15 | /// Method to generate a random Color Scheme that's either light or dark. 16 | ColorScheme randomColorScheme( 17 | {int? seed, bool isDark = true, bool shouldPrint = true}) { 18 | if (isDark) { 19 | return randomColorSchemeDark(seed: seed, shouldPrint: shouldPrint); 20 | } else { 21 | return randomColorSchemeLight(seed: seed, shouldPrint: shouldPrint); 22 | } 23 | } 24 | 25 | /// Generates a random Color Scheme with a dark theme. 26 | /// Properties set: [primary, primaryVariant, secondary, surface, background] 27 | /// 28 | /// Input: an optional seed for the Random function. 29 | /// 30 | /// Input: an option bool to enable/disable printing to console 31 | /// Output: a random ColorScheme. 32 | ColorScheme randomColorSchemeDark({int? seed, bool shouldPrint = true}) { 33 | final colors = _getRandomMaterialDark(seed: seed); 34 | if (shouldPrint) { 35 | print(''' 36 | ColorScheme.dark( 37 | primary: ${colors[_kPrimary]!.toColor()}, 38 | primaryContainer: ${colors[_kPrimaryContainer]!.toColor()}, 39 | secondary: ${colors[_kSecondary]!.toColor()}, 40 | secondaryContainer: ${colors[_kSecondaryContainer]!.toColor()}, 41 | surface: ${colors[_kSurface]!.toColor()}, 42 | background: ${colors[_kBackground]!.toColor()}, 43 | ) 44 | '''); 45 | } 46 | 47 | return ColorScheme.dark( 48 | primary: colors[_kPrimary]!.toColor(), 49 | primaryContainer: colors[_kPrimaryContainer]!.toColor(), 50 | secondary: colors[_kSecondary]!.toColor(), 51 | secondaryContainer: colors[_kSecondaryContainer]!.toColor(), 52 | surface: colors[_kSurface]!.toColor(), 53 | background: colors[_kBackground]!.toColor(), 54 | ); 55 | } 56 | 57 | /// Generates a random Color Scheme with a light theme. 58 | /// Properties set: [primary, primaryVariant, secondary, surface, background] 59 | /// 60 | /// Input: an optional seed for the Random function. 61 | /// 62 | /// Input: an option bool to enable/disable printing to console 63 | /// Output: a random ColorScheme. 64 | ColorScheme randomColorSchemeLight({int? seed, bool shouldPrint = true}) { 65 | final colors = _getRandomMaterialLight(seed: seed); 66 | 67 | if (shouldPrint) { 68 | print(''' 69 | ColorScheme.light( 70 | primary: ${colors[_kPrimary]!.toColor()}, 71 | primaryContainer: ${colors[_kPrimaryContainer]!.toColor()}, 72 | secondary: ${colors[_kSecondary]!.toColor()}, 73 | secondaryContainer: ${colors[_kSecondaryContainer]!.toColor()}, 74 | surface: ${colors[_kSurface]!.toColor()}, 75 | background: ${colors[_kBackground]!.toColor()}, 76 | ) 77 | '''); 78 | } 79 | 80 | return ColorScheme.light( 81 | primary: colors[_kPrimary]!.toColor(), 82 | primaryContainer: colors[_kPrimaryContainer]!.toColor(), 83 | secondary: colors[_kSecondary]!.toColor(), 84 | secondaryContainer: colors[_kSecondaryContainer]!.toColor(), 85 | surface: colors[_kSurface]!.toColor(), 86 | background: colors[_kBackground]!.toColor(), 87 | ); 88 | } 89 | 90 | /// Generates a random dark theme that tries to be Material complaint. 91 | /// 92 | /// PRIMARY COLOR 93 | /// Reason 1: 94 | /// > "fully saturated brand color is applied to the floating action button" 95 | /// 96 | /// Reason 2: 97 | /// Looking at Material Colors in HSV: 98 | /// Primary - H: 267 S: 47 V: 99 99 | /// Secondary - H: 174 S: 99 V: 85 100 | /// OWL - H: 345 S: 54 V: 100 101 | /// We get this range: 50 < S < 100 and V > 80 (currently not being used) 102 | /// 103 | /// Looking at Material Colors in HSLuv: 104 | /// Primary - H: 281 S: 97 L: 65 105 | /// Secondary - H: 176 S: 100 L: 79 106 | /// OWL - H: 360 S: 100 L: 67 107 | /// We get this range: S > 90 and 65 < L < 85 108 | /// 109 | /// Conclusion: 110 | /// Primary has a saturation of [60-100] and lightness of [65-85]. 111 | /// 112 | /// PRIMARY VARIANT COLOR 113 | /// Same as Primary, but with lightness = lightness - 10. 114 | /// 115 | /// SECONDARY 116 | /// Same saturation and lightness as Primary, but hue is different. 117 | /// The difference from Material's default Primary and Secondary is ~105. 118 | /// Therefore, hue = (hue + 90 + random(90)) % 180. 119 | /// It will have a difference between [90, 180]. 120 | /// 121 | /// BACKGROUND 122 | /// Has a lightness between [0, 25]. 123 | /// 124 | /// SURFACE 125 | /// Has a lightness between [0, 30]. However, if: 126 | /// abs(surfaceLightness - backgroundLightness) < 5, 127 | /// just make the surfaceLightness = backgroundLightness + 5. 128 | /// Surface's lightness can be lower than background's lightness. 129 | /// That was a deliberate choice. 130 | /// 131 | Map _getRandomMaterialDark({int? seed}) { 132 | final rng = math.Random(seed); 133 | 134 | // avoid too similar values between background and surface. 135 | final backgroundLightness = rng.nextInt(26); 136 | var surfaceLightness = rng.nextInt(31); 137 | if ((surfaceLightness - backgroundLightness).abs() < 5) { 138 | surfaceLightness = backgroundLightness + 5; 139 | } 140 | 141 | final primaryHue = rng.nextInt(360); 142 | final primarySaturation = 60 + rng.nextInt(41).toDouble(); 143 | final primaryLightness = 65 + rng.nextInt(21).toDouble(); 144 | 145 | final secondaryHue = ((primaryHue + 90 + rng.nextInt(90)) % 360).toDouble(); 146 | 147 | return { 148 | _kPrimary: HSLuvColor.fromHSL( 149 | primaryHue.toDouble(), 150 | primarySaturation, 151 | primaryLightness.toDouble(), 152 | ), 153 | _kPrimaryContainer: HSLuvColor.fromHSL( 154 | primaryHue.toDouble(), 155 | primarySaturation, 156 | primaryLightness - 10.0, 157 | ), 158 | _kSecondary: HSLuvColor.fromHSL( 159 | secondaryHue, 160 | primarySaturation, 161 | primaryLightness, 162 | ), 163 | _kSecondaryContainer: HSLuvColor.fromHSL( 164 | secondaryHue, 165 | primarySaturation, 166 | primaryLightness - 10.0, 167 | ), 168 | _kSurface: HSLuvColor.fromHSL( 169 | rng.nextInt(360).toDouble(), 170 | rng.nextInt(101).toDouble(), 171 | surfaceLightness.toDouble(), 172 | ), 173 | _kBackground: HSLuvColor.fromHSL( 174 | rng.nextInt(360).toDouble(), 175 | rng.nextInt(101).toDouble(), 176 | backgroundLightness.toDouble(), 177 | ), 178 | }; 179 | } 180 | 181 | /// Generates a random light theme that tries to be Material complaint. 182 | /// 183 | /// PRIMARY COLOR 184 | /// Looking at Material Colors in HSV: 185 | /// Primary - H: 265 S: 100 V: 93 186 | /// Secondary - 174 S: 99 L: 85 187 | /// We get this range: S > 90 and V > 80 (currently not being used) 188 | /// 189 | /// Looking at Material Colors in HSLuv: 190 | /// Primary - H: 272 S: 100 L: 36 191 | /// Secondary - H: 177 S: 100 L: 79 192 | /// We get this range: S > 90 and 35 < L < 80 193 | /// 194 | /// Conclusion: 195 | /// Primary has a saturation of [80-100] and lightness of [25-45]. 196 | /// 197 | /// PRIMARY VARIANT COLOR 198 | /// Same as Primary, but with lightness = lightness - 10. 199 | /// 200 | /// SECONDARY 201 | /// Same saturation and lightness as Primary, but hue is different. 202 | /// The difference from Material's default Primary and Secondary is ~105. 203 | /// Therefore, hue = (hue + 90 + random(90)) % 180. 204 | /// It will have a difference between [90, 180]. 205 | /// 206 | /// BACKGROUND 207 | /// It is very bright [75-100], saturation stops at 70. 208 | /// 209 | /// SURFACE 210 | /// Has a lightness between [25, 45]. 211 | /// 212 | Map _getRandomMaterialLight({int? seed}) { 213 | final rng = math.Random(seed); 214 | 215 | final primaryHue = rng.nextInt(360); 216 | final primarySaturation = 80.0 + rng.nextInt(16); 217 | final primaryLightness = 25 + rng.nextInt(21); 218 | 219 | final secondaryHue = ((primaryHue + 90 + rng.nextInt(90)) % 360).toDouble(); 220 | 221 | return { 222 | _kPrimary: HSLuvColor.fromHSL( 223 | primaryHue.toDouble(), 224 | primarySaturation, 225 | primaryLightness.toDouble(), 226 | ), 227 | _kPrimaryContainer: HSLuvColor.fromHSL( 228 | primaryHue.toDouble(), 229 | primarySaturation, 230 | primaryLightness - 10.0, 231 | ), 232 | _kSecondary: HSLuvColor.fromHSL( 233 | secondaryHue, 234 | primarySaturation, 235 | primaryLightness.toDouble(), 236 | ), 237 | _kSecondaryContainer: HSLuvColor.fromHSL( 238 | secondaryHue, 239 | primarySaturation, 240 | primaryLightness - 10.0, 241 | ), 242 | _kSurface: HSLuvColor.fromHSL( 243 | rng.nextInt(360).toDouble(), 244 | 20.0 + rng.nextInt(81), 245 | primaryLightness + 45.0 + rng.nextInt(56 - primaryLightness), 246 | ), 247 | _kBackground: HSLuvColor.fromHSL( 248 | rng.nextInt(360).toDouble(), 249 | rng.nextInt(71).toDouble(), 250 | primaryLightness + 45.0 + rng.nextInt(56 - primaryLightness), 251 | ), 252 | }; 253 | } 254 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_test: 58 | dependency: "direct dev" 59 | description: flutter 60 | source: sdk 61 | version: "0.0.0" 62 | hsluv: 63 | dependency: "direct main" 64 | description: 65 | name: hsluv 66 | sha256: f33e63b0c24ceee0f6492874424aa8edc671ef9a20cc889e4b969284d8f02eb1 67 | url: "https://pub.dev" 68 | source: hosted 69 | version: "1.1.3" 70 | js: 71 | dependency: transitive 72 | description: 73 | name: js 74 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "0.6.5" 78 | matcher: 79 | dependency: transitive 80 | description: 81 | name: matcher 82 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "0.12.13" 86 | material_color_utilities: 87 | dependency: transitive 88 | description: 89 | name: material_color_utilities 90 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "0.2.0" 94 | meta: 95 | dependency: transitive 96 | description: 97 | name: meta 98 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "1.8.0" 102 | path: 103 | dependency: transitive 104 | description: 105 | name: path 106 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "1.8.2" 110 | sky_engine: 111 | dependency: transitive 112 | description: flutter 113 | source: sdk 114 | version: "0.0.99" 115 | source_span: 116 | dependency: transitive 117 | description: 118 | name: source_span 119 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 120 | url: "https://pub.dev" 121 | source: hosted 122 | version: "1.9.1" 123 | stack_trace: 124 | dependency: transitive 125 | description: 126 | name: stack_trace 127 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "1.11.0" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "2.1.1" 139 | string_scanner: 140 | dependency: transitive 141 | description: 142 | name: string_scanner 143 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.2.0" 147 | term_glyph: 148 | dependency: transitive 149 | description: 150 | name: term_glyph 151 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "1.2.1" 155 | test_api: 156 | dependency: transitive 157 | description: 158 | name: test_api 159 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "0.4.16" 163 | vector_math: 164 | dependency: transitive 165 | description: 166 | name: vector_math 167 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "2.1.4" 171 | sdks: 172 | dart: ">=2.19.0 <3.0.0" 173 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: random_color_scheme 2 | description: Generate light and dark color schemes to help you theme an app. 3 | version: 0.1.4 4 | homepage: https://github.com/bernaferrari/RandomColorScheme 5 | 6 | environment: 7 | sdk: '>=2.19.0 <4.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | hsluv: ^1.1.3 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | -------------------------------------------------------------------------------- /test/random_color_scheme_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:random_color_scheme/random_color_scheme.dart'; 5 | 6 | void main() { 7 | test('test simple dark scenario', () { 8 | final colorScheme = randomColorSchemeDark(seed: 0); 9 | expect(colorScheme.primary, Color(0xff89b9ee)); 10 | expect(colorScheme.primaryContainer, Color(0xff54a0e2)); 11 | expect(colorScheme.secondary, Color(0xfff1a28c)); 12 | expect(colorScheme.secondaryContainer, Color(0xffee7a4b)); 13 | expect(colorScheme.surface, Color(0xff0e0000)); 14 | expect(colorScheme.background, Color(0xff2a4024)); 15 | 16 | // unchanged 17 | expect(colorScheme.onPrimary, Color(0xff000000)); 18 | expect(colorScheme.onBackground, Color(0xffffffff)); 19 | expect(colorScheme.onSurface, Color(0xffffffff)); 20 | }); 21 | 22 | test('test simple light scenario', () { 23 | final colorScheme = randomColorSchemeLight(seed: 0); 24 | expect(colorScheme.primary, Color(0xff2c589f)); 25 | expect(colorScheme.primaryContainer, Color(0xff1f4178)); 26 | expect(colorScheme.secondary, Color(0xff6a5723)); 27 | expect(colorScheme.secondaryContainer, Color(0xff4f4017)); 28 | expect(colorScheme.surface, Color(0xfffbf4f5)); 29 | expect(colorScheme.background, Color(0xfffeffff)); 30 | 31 | // unchanged 32 | expect(colorScheme.onPrimary, Color(0xffffffff)); 33 | expect(colorScheme.onBackground, Color(0xff000000)); 34 | expect(colorScheme.onSurface, Color(0xff000000)); 35 | }); 36 | } 37 | --------------------------------------------------------------------------------