Skip to content

Commit

Permalink
Publish version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Aug 30, 2022
1 parent 63fbe88 commit e613c37
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: "Install Flutter and Dart SDK"
uses: subosito/[email protected]
with:
channel: "beta"
channel: "stable"
- name: "Show Dart SDK version"
run: dart --version
- name: "Show Flutter SDK version"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to the **FlexSeedScheme** (FSS) package are documented here.

## 1.0.0

**Aug 30, 2022**

First stable release.

* Document updates
* Updated minimum dependencies to Dart >=2.18.0 and Flutter >= 3.3.0.

## 0.2.0-dev.2

**Aug 28, 2022**
Expand Down
5 changes: 3 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.2.0-dev.1"
version: "1.0.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -150,4 +150,5 @@ packages:
source: hosted
version: "2.1.2"
sdks:
dart: ">=2.18.0-271.4.beta <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
5 changes: 3 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: flex_seed_scheme_example
description: Example that demonstrate how to use the FlexSeedScheme package.
version: 0.2.0-dev.2
version: 1.0.0
publish_to: 'none'
environment:
sdk: '>=2.18.0-271.4.beta <3.0.0'
sdk: '>=2.18.0 <3.0.0'
flutter: '>=3.3.0'

dependencies:
# Adds the Cupertino Icons font to your application. Used by the
Expand Down
22 changes: 12 additions & 10 deletions lib/src/flex_core_palette.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import 'package:meta/meta.dart' show immutable;
/// chroma, but vary in tone.
///
/// This is a modification of package material_color_utilities [TonalPalette]
/// to be able to add the tone 98, that the Web based Material 3 theme builder
/// made to include the tone 98, that the Web based Material 3 theme builder
/// has, as well as an additional custom tone, 5.
///
/// This class can be instantiated in two ways:
Expand All @@ -60,13 +60,13 @@ import 'package:meta/meta.dart' show immutable;
/// corresponding to [commonTones].
@immutable
class FlexTonalPalette {
// If changed commonTones length, update commonSize to commonTones.length.
// There is a test and assert that fails if you did not.
//
// If modifying commonTones length, update commonSize to equal
// commonTones.length. There is a test and assert that fails if you did not.

/// Commonly-used tone values in a [FlexTonalPalette].
///
/// Contains custom tones 5 and 98, in addition to the 13 tones included
/// in the Material 3 guide. The tone 98 also exists in the
/// in the Material 3 guide tonal palette. The tone 98 also exists in the
/// [Web Material Theme Builder app](https://m3.material.io/theme-builder#/custom),
/// but not in Flutter or
/// [Material Color Utilities package](https://pub.dev/packages/material_color_utilities).
Expand All @@ -89,9 +89,9 @@ class FlexTonalPalette {
100,
];

// If you changed commonTones length, update commonSize to commonTones.length.
// There is a test and assert that fails if you did not.
//
// If modifying commonTones length, update commonSize to equal
// commonTones.length. There is a test and assert that fails if you did not.

/// Number of tones in [commonTones].
///
/// In original implementation package material_color_utilities this is
Expand Down Expand Up @@ -190,7 +190,7 @@ class FlexTonalPalette {

/// An intermediate concept between the key color for a UI theme, and a full
/// color scheme. Five tonal palettes are generated, plus a default
/// error palette.
/// error palette if not provided.
///
/// This is a modification of package:material_color_utilities [CorePalette],
/// to make it possible to create Material 3 seeded ColorScheme using tonal
Expand All @@ -201,7 +201,9 @@ class FlexTonalPalette {
/// This implementation also has an unnamed constructor for the five main final
/// [FlexTonalPalette] properties. Exposes the original version's private
/// constructor [FlaxCorePalette.fromHueChroma], that is used by
/// [FlexCorePalette.of]. It also adds a [FlexCorePalette.fromSeeds] constructor
/// [FlexCorePalette.of].
///
/// It adds a [FlexCorePalette.fromSeeds] constructor
/// to enable creating the [FlexTonalPalette]s for primary, secondary and
/// tertiary color groups using optional ARGB seed colors, for secondary and
/// tertiary [FlexTonalPalette]s, instead of tying them down to same seed ARGB
Expand Down
8 changes: 4 additions & 4 deletions lib/src/flex_seed_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import 'flex_tones.dart';
///
/// 1) Three seed colors instead of just one.
///
/// Instead of [CorePalette] it uses inherited version called [FlexCorePalette]
/// Instead of [CorePalette] it uses custom version called [FlexCorePalette]
/// that enables using 1, 2 or 3 seed colors for more degrees
/// of freedom in seeded ColorScheme, using defined seed colors for
/// primary, secondary and tertiary colors. The extended [FlexCorePalette]
/// primary, secondary and tertiary colors. The custom [FlexCorePalette]
/// version also allows for adjusting chroma usage and levels that are
/// hard coded into M3 design [CorePalette].
///
Expand Down Expand Up @@ -184,8 +184,8 @@ class FlexSeedScheme {
/// tones mapping.
///
/// A [FlexSeedScheme] cannot be created externally. It is only used
/// internally to create a seeded [ColorScheme] via its static method
/// [FlexSeedScheme.fromSeeds] from one, two or three seed
/// internally to create a seeded [ColorScheme] via its static extension
/// [SeedColorScheme.fromSeeds] from one, two or three seed
/// colors, and with customizable [FlexTones] tone mapping to [ColorScheme].
factory FlexSeedScheme._tones({
required int primaryKey,
Expand Down
35 changes: 14 additions & 21 deletions lib/src/flex_tones.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import 'package:flutter/foundation.dart';
// ignore_for_file: comment_references

/// Configuration data class that defines which tone to use from each
/// [TonalPalette] when assigning used color to each [ColorScheme] color.
/// [FlexTonalPalette] when assigning used color to each [ColorScheme] color.
///
/// It is also possible to define how Cam16 chroma is used and limited when
/// generating the tonal palette.
///
/// To use [FlexTones] pass in one of the predefined configs to [tones]:
/// To use [FlexTones] pass in one of the predefined configs to `tones`]:
///
/// * FlexTones.material, default and same as Flutter SDK M3 setup.
/// * FlexTones.soft, softer and earthier tones than M3 FlexTones.material.
Expand All @@ -24,32 +24,25 @@ import 'package:flutter/foundation.dart';
///
/// You can also easily create custom configurations by using the
/// [FlexTones.light] and [FlexTones.dark] factories that have defaults that
/// match the Material 3 design setup. Just modify the properties you
/// match the Material 3 design setup tone mapping wise, but don't lock
/// chroma bu default. Just modify the properties you
/// want to change. The above pre-made constructors are examples of doing this.
///
/// When [TonalPalette]s are generated from key color(s) and used to define
/// When [FlexTonalPalette]s are generated from key color(s) and used to define
/// a [ColorScheme], it is recommended to use the same key colors and
/// [FlexTones] setup for both the light and dark theme. By doing so the
/// same [TonalPalette] is used to assign suitable tones from the same
/// [TonalPalette] but using different tones.
/// same [FlexTonalPalette] is used to assign suitable tones from identical
/// [FlexTonalPalette], but using different tones for light and dark
/// [Brightness].
///
/// When you use [FlexColorScheme.dark] and its built in schemes via [scheme]
/// enum property, it automatically uses the light mode [primary],
/// [secondary] and [tertiary] color definitions as seed keys for their
/// respective tonal palette generation. Thus creating identical [TonalPalettes]
/// for dark mode as for light mode and using the tones based and chroma setup
/// from provided or default [FlexTones].
/// The [FlexTones.light] and [FlexTones.dark] constructors match the
/// definition used by Material Design 3 based seed generated tones, for
/// the tone mapping, however chroma is by default unbound. Use the
/// [FlexTones.material], for an exact match.
///
/// If you make custom color schemes using [FlexColorScheme] it is up to you
/// to define what colors you use when you use key colors to seed
/// [ColorScheme]s.
///
/// The used default [FlexTones.light] and [FlexTones.dark] match the definition
/// Flutter SDK uses for its Material Design 3 based seed generated tones.
/// In Flutter SDK this tone mapping and chroma setup is done with hard coded
/// values in [ColorScheme.fromSeed] and libraries it uses. You have to go to
/// lower APIs and open them up a bit to offer the possibilities and flexibility
/// FlexColorScheme provides as configurable parameters.
/// values in [ColorScheme.fromSeed] and libraries it uses. This class offers
/// configuration of those parameters.
@immutable
class FlexTones with Diagnosticable {
/// Default constructor requiring all properties.
Expand Down
3 changes: 2 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.18.0-271.4.beta <3.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: flex_seed_scheme
description: A more flexible version of Flutter's ColorScheme.fromSeed, use multiple seed colors, custom chroma and tone mapping.
version: 0.2.0-dev.2
version: 1.0.0
homepage: https://github.com/rydmike/flex_seed_scheme
repository: https://github.com/rydmike/flex_seed_scheme
issue_tracker: https://github.com/rydmike/flex_seed_scheme/issues
documentation: https://github.com/rydmike/flex_seed_scheme/blob/master/README.md

environment:
sdk: '>=2.18.0-271.4.beta <3.0.0'
sdk: '>=2.18.0 <3.0.0'
flutter: '>=3.3.0'

dependencies:
flutter:
Expand Down

0 comments on commit e613c37

Please sign in to comment.