p-hatan/ mirror

pub repository

mirror.p-hatan.ir

material_color_utilities

0.13.0

Algorithms and utilities that power the Material Design 3 color system, including choosing theme colors from images and creating tones of colors; all in a new color space.

Download archive

Readme

material_color_utilities

pub package

Algorithms and utilities that power the Material Design 3 color system, including choosing theme colors from images and creating tones of colors; all in a new color space.

This is a low-level package. For developers looking to adopt Material 3 features such as dynamic color and color harmonization in their apps, please see the dynamic_color package.

Getting started

dart pub add material_color_utilities or flutter pub add material_color_utilities

Usage

import 'package:material_color_utilities/material_color_utilities.dart';

For more information, see the main README.

Contributing

This repo is not accepting external contributions, but feature requests and bug reports are welcome on GitHub.

Changelog

0.13.0 - 2025-05-20

  • All of the MaterialDynamicColors fields are now final.
  • Require Dart 3.5

0.12.0 - 2024-06-06

Changed

  • Updated MaterialDynamicColors to use the expressive on-colors spec.

0.11.2 - 2024-04-30

Changed

  • Updated TonalPalette to use new key color algorithm.

0.11.1 - 2024-03-11

Fixed

  • Fixed Apache license

0.11.0 - 2024-02-20

Changed

  • Updated TonalPalette.fromList so that it provides colors at any tone, not only at commonTones.

0.10.0 - 2023-11-27

Changed

  • Updated MaterialDynamicColors to new Contrast Surfaces spec.

0.9.0 - 2023-11-06

Added

  • Added getters for DynamicScheme.

Changed

  • Moved DynamicScheme from scheme/ to dynamiccolor/.

0.8.0 - 2023-06-22

Added

  • Add fruit salad color scheme
  • Add rainbow color scheme

0.7.0 - 2023-06-13

Changed

  • Updated DynamicColor so that it conforms to the new contrast requirements.
    • API for DynamicColor modified.

0.6.0 - 2023-05-31

Added

  • Add key color to tonal palette.
  • Add key colors to the Material dynamic colors:
    • primaryPaletteKeyColor
    • secondaryPaletteKeyColor
    • tertiaryPaletteKeyColor
    • neutralPaletteKeyColor
    • neutralVariantPaletteKeyColor

Changed

  • Scheme updates to align with recent Android Sys UI changes:
    • SchemeExpressive:
      • Primary hue + 240 from 120
      • Neutral hue + 15
      • Neutral variant hue + 15
    • SchemeTonalSpot:
      • Primary chroma = 36 from 40
    • SchemeVibrant:
      • Neutral chroma = 10 from 8

Fixed

  • Fixed outline when in dark mode to be tone 60.

0.5.0 - 2023-05-02

Removed

  • Removed inverseOnPrimary, an unfounded dynamic color

0.4.0 - 2023-04-28

Added

  • Add label and description to each Variant
  • Add xFixed Material dynamic colors

Changed

  • Update monochrome scheme to new spec

Fixed

  • Fix inverseSurface tone value

0.3.0 - 2023-03-10

Added

  • Add 4 new components:
    • contrast: Use Contrast for utility methods
    • dislike: Use DislikeAnalyzer for checking and fixing universally disliked colors
    • dynamiccolor: Use DynamicColor and MaterialDynamicColors for colors from a DynamicScheme, that adjust based on UI state (dark theme, style, preferences, contrast requirements, etc.)
    • temperature: Use TemperatureCache for analogous & complementary colors
  • scheme: Add DynamicScheme and its subclasses:
    • SchemeExpressive
    • SchemeMonochrome
    • SchemeNeutral
    • SchemeTonalSpot
    • SchemeVibrant
    • SchemeFidelity
    • SchemeContent
  • hct: Add inViewingConditions to hct, for color relativity
  • utilities: Add lstarFromY method, utility to which is the inverse of yFromLstar

Changed

  • Export all public API in material_color_utilities.dart
  • Bump minimum Flutter SDK version to 2.17.0

Fixed

  • Fix missing hashCode override for Hct
  • Fix TonalPalette equality operator when different constructors are used (#56)

0.2.0 - 2022-08-05

Added

  • Add support for content color
  • Add outlineVariant and scrim colors

Changed

  • Rename CamSolver to HctSolver

Fixed

  • Correct repository in pubspec

0.1.5 - 2022-04-25

Added

  • Introduce CamSolver, a fast solver for the HCT equation. Highly performant, but a small breaking change
  • Add explanation and link to dynamic_color packages
  • Add operator == and toString overrides to Hct

Changed

  • Improve documentation for color_utils.dart
  • Rename HctColor to Hct

Fixed

  • Fix README import

0.1.4 - 2022-01-21

Added

  • Allow creation of Scheme from a CorePalette with lightFromCorePalette and darkFromCorePalette

0.1.3 - 2021-12-10

Added

  • Export Scheme

0.1.2 - 2021-12-02

Changed

  • Update Scheme tonal values
  • Move matcher to pubspec's dev_dependencies

0.1.1 - 2021-10-28

Changed

  • Update pubspec description

Fixed

  • Fix matcher version incompatibility with flutter stable

0.1.0 - 2021-10-28

Added

  • Create library

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add material_color_utilities
pubspec.yaml
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: material_color_utilities
description: Algorithms and utilities that power the Material Design 3 color system, including choosing theme colors from images and creating tones of colors; all in a new color space.
version: 0.13.0
repository: https://github.com/material-foundation/material-color-utilities/tree/main/dart
issue_tracker: https://github.com/material-foundation/material-color-utilities/issues
screenshots:
  - description: "App showing the Material You color system."
    path: screenshots/material_you_1.png
  - description: "App showing the Material You color system."
    path: screenshots/material_you_2.png
  - description: "App showing the Material You color system."
    path: screenshots/material_you_3.png
  - description: "App showing the Material You color system."
    path: screenshots/material_you_4.png

environment:
  sdk: ^3.5.0

dependencies:
  collection: ^1.15.0 # used by tonal_palette.dart

dev_dependencies:
  dart_flutter_team_lints: ^3.0.0
  matcher: ^0.12.0 # used by color_matcher.dart
  test: ^1.16.0

Version history

VersionPublishedArchiveSHA-256
0.1.02021-10-28T14:39:42.858732ZDownloadeb205bd0d00f34c492a15ab3332bd4eb3141322a77d4c2ad2e10861ecf3b5af5
0.1.12021-10-28T16:05:17.476202ZDownloada70544bad230b724b5536c5ed2955d14e71e83de289126e4fb4bac9d1dbd21b6
0.1.22021-12-02T14:57:25.214933ZDownload57f0c5997cdb339e2f00e7408710275c5bb3661daaee8467ff9862f9d258dd58
0.1.32021-12-10T12:04:21.996609ZDownload08a930be3079071b6024191d7a597326c11b1f62e1c65de2fe1cb7654845ac1b
0.1.42022-01-21T17:40:48.050965ZDownloadc439ea29c3596283975647da36038c3a842a464535888df1a812b422f0bf160f
0.1.52022-04-25T12:28:53.761088ZDownload3e44388ce13d4d9a393e6b93dce4b958160edd02d38a552a3a0a0f38c445d98b
0.2.02022-08-05T17:19:08.486011ZDownloadd92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
0.3.02023-03-13T15:49:06.675925ZDownload586678f20e112219ed0f73215f01bcdf1d769824ba2ebae45ad918a9bfde9bdb
0.4.02023-05-03T10:23:13.616288ZDownload28caca2b8f832e7b6836e55dcdb49bbecb552a25032dd8cbde9aa291484c8ae8
0.5.02023-05-03T10:24:11.011335ZDownload9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41
0.6.02023-06-16T10:48:42.608465ZDownload8c706610e4726f95d7b6fbe00d10918c8633e7eb6f76d3d29fa7da7bc93f2466
0.7.02023-06-22T10:19:05.524565ZDownloadfe275c8e3fbd40b8e46fa93e84951e8eee3721b6b28e199b577c6188c22e4510
0.8.02023-06-29T10:01:17.966113ZDownload0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a
0.9.02024-03-11T16:39:04.238387ZDownload8289611b8b7641397a412901596a9e041f4df2201714160fc0b54d936def804d
0.10.02024-03-11T16:39:38.807516ZDownloadeebdbb0980a944fa1e1b74977c956652641aff8df2aae5e2e80ab16da4962861
0.11.02024-03-11T16:39:51.174799ZDownloadb0292aef430a1ffff816c83e7d63332a0a4df72b818466a49dc7fc3ab38d6bff
0.11.12024-03-13T16:06:28.166042ZDownloadf7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
0.12.02024-06-06T16:30:43.736723ZDownloadafaac3ebbf67448ab81c891b8e1f2f4d3e7bc19aa36d269c0257b54bc0d9aa79
0.13.02025-06-04T16:40:01.638488ZDownload9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b
0.13.12026-08-10T14:58:12.420872ZDownloadcda64b65529b9737e5c9bf7ef386c907f2a58707039a3033788030da927133d0

Dependencies

collection "^1.15.0"