{"id":30841836,"url":"https://github.com/dartoos-dev/eo_color","last_synced_at":"2025-09-06T20:09:59.621Z","repository":{"id":45089166,"uuid":"366858185","full_name":"dartoos-dev/eo_color","owner":"dartoos-dev","description":"An elegant, object-oriented implementation of the Material Design color palettes and swatches.","archived":false,"fork":false,"pushed_at":"2024-08-26T13:29:30.000Z","size":420,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-28T17:02:21.897Z","etag":null,"topics":["accented-colors","color","color-palette","color-palettes","color-swatch","color-swatches","eo-color","flutter","greys","material","material-design","swatches"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dartoos-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-12T21:28:06.000Z","updated_at":"2024-08-26T13:29:31.000Z","dependencies_parsed_at":"2024-08-26T15:39:29.119Z","dependency_job_id":"ea8909c2-4c01-4ceb-85e5-0ef53948ff9e","html_url":"https://github.com/dartoos-dev/eo_color","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/dartoos-dev/eo_color","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartoos-dev%2Feo_color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartoos-dev%2Feo_color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartoos-dev%2Feo_color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartoos-dev%2Feo_color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dartoos-dev","download_url":"https://codeload.github.com/dartoos-dev/eo_color/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartoos-dev%2Feo_color/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273956236,"owners_count":25197587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accented-colors","color","color-palette","color-palettes","color-swatch","color-swatches","eo-color","flutter","greys","material","material-design","swatches"],"created_at":"2025-09-06T20:09:57.642Z","updated_at":"2025-09-06T20:09:59.608Z","avatar_url":"https://github.com/dartoos-dev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg\nsrc=\"https://user-images.githubusercontent.com/24878574/118523677-bdb5c500-b713-11eb-942f-26a7e0b4554e.png\"\nalt=\"EO-Color logo\" width=\"112\" height=\"96\"/\u003e\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](https://www.rultor.com/b/dartoos-dev/eo_color)](https://www.rultor.com/p/dartoos-dev/eo_color)\n\n[![pub](https://img.shields.io/pub/v/eo_color)](https://pub.dev/packages/eo_color)\n[![license](https://img.shields.io/badge/license-mit-green.svg)](https://github.com/dartoos-dev/eo_color/blob/master/LICENSE)\n\u003c!-- [![PDD status](https://www.0pdd.com/svg?name=dartoos-dev/eo_color)](https://www.0pdd.com/p?name=dartoos-dev/eo_color) --\u003e\n\n[![build](https://github.com/dartoos-dev/eo_color/actions/workflows/build.yml/badge.svg)](https://github.com/dartoos-dev/eo_color/actions/)\n[![codecov](https://codecov.io/gh/dartoos-dev/eo_color/branch/master/graph/badge.svg)](https://codecov.io/gh/dartoos-dev/eo_color)\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/rafamizes/eo_color)](https://www.codefactor.io/repository/github/rafamizes/eo_color)\n[![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)\n[![Hits-of-Code](https://hitsofcode.com/github/dartoos-dev/eo_color?branch=master)](https://hitsofcode.com/github/dartoos-dev/eo_color/view?branch=master)\n\n## Contents\n\n- [Overview](#overview)\n- [Getting Started](#getting-started)\n- [Palette interface](#palette-interface)\n- [Numeric indexes X Named constructors](#numeric-indexes-vs-named-constructors)\n- [Swatch interface](#swatch-interface)\n- [Swatch in action](#swatch-in-action)\n- [Gradient interface](#gradient-interface)\n- [Demo application](#demo-application)\n- [Contribute](#contribute)\n- [References](#references)\n\n## Overview\n\n**EO-Color** is an **E**legant, **O**bject-oriented implementation of the\nMaterial Design color palettes and swatches — as well as a color framework!\n\nIt is intended to be used as:\n\n- an alternative to Flutter's built-in colors.\n- a base framework for more specific color packages.\n\nA key benefit of **EO-Color** is to improve the source code readability and\nmaintainability by providing declarative interfaces.\n\nThe use of **obscure numeric indexes** such as 100, 200…800, 900 to select the\nshade of a color has been replaced by a more user-friendly approach: the use of\n**adverbs** (ultra, very, bit, etc.) and **adjectives** (light, dark, etc.).\n\nFor example, to get the primary shade of grey, simply **declare** `Grey()`.\nLikewise, there are commands for retrieving shades of grey that are either\nlighter or darker than the primary shade.\n\n- **lighter shades**: `Grey.bitLighter()`, `Grey.lighter()`, `Grey.light()`,\n  `Grey.veryLight()`, or `Grey.ultraLight()` for the lightest shade of grey.\n- **darker shades**: `Grey.bitDarker()`, `Grey.darker()`, `Grey.dark()`, or\n  `Grey.veryDark()` for the darkest shade.\n\nWith the exception of black and white, the same command patterns (light,\nlighter, dark, etc.) also apply to all other\n[colors](https://pub.dev/documentation/eo_color/latest/palettes/palettes-library.html)\n\n## Getting Started\n\nLike any other object-oriented package, this one uses interfaces to define\nconcepts such as the color palette, color swatch and color gradient; therefore,\nthe three main interfaces are `Palette`, `Swatch` and `Gradient`.\n\n## Palette interface\n\nThe\n[Palette](https://pub.dev/documentation/eo_color/latest/palettes/Palette-class.html)\ninterface represents color palettes from which a color can be selected.\n\nTypically, subclasses of the _Palette_ interface provide named constructors by\nwhich the desired color is selected — to be retrieved later using the `color`\nproperty.\n\nFor instance, the command `Blue()` retrieves the primary shade of blue, and it\nis equivalent to the Flutter command `Colors.blue.shade500`. Similarly,\n`Blue.veryLight()` is equivalent to `Colors.blue.shade50`; `Blue.veryDark()`, to\n`Colors.grey.shade900`; and so on.\n\nThe code snippet below demonstrates how to build a bluish Flutter Container\nwidget using the `Blue` color class.\n\n**Code snippet:**\n\n```dart\n/// Builds a bluish container.\n@override\nWidget build(BuildContext context) {\n  return Container(color: const Blue().color);\n}\n```\n\nAll Material Design colors — along with their respective accent-colors — have\nbeen implemented.\n\nFor a complete list of colors with detailed information (hex codes, indexes,\nopacity, etc.), see:\n\n- [color-palettes-library](https://pub.dev/documentation/eo_color/latest/palettes/palettes-library.html)\n\n### Numeric indexes vs. Named constructors\n\nThe table below contains the relationship between the Material Design indexes\n(100, 200…800, 900) and the named constructors of the color classes.\n\n- **Note:**\n  - The **\"Normal\"** column refers to classes that represent non-accent colors\n    such as _Amber_, _Green_, _Red_, etc.\n  - On the other hande, the **\"Accent\"** column refers to classes that represent\n    accent colors such as _AmberAccent_, _GreenAccent_, _RedAccent_, and so on.\n  - Finally, **\"()\"** refers to the default constructor, which in turn\n    represents the primary shade of the color class it belongs to.\n\n| Index | Normal     | Accent |\n| :---- | ---------- | :----- |\n| 50    | ultraLight |        |\n| 100   | veryLight  | light  |\n| 200   | light      | ()     |\n| 300   | lighter    |        |\n| 400   | bitLighter | darker |\n| 500   | ()         |        |\n| 600   | bitDarker  |        |\n| 700   | darker     | dark   |\n| 800   | dark       |        |\n| 900   | veryDark   |        |\n\n## Swatch interface\n\nThe\n[Swatch](https://pub.dev/documentation/eo_color/latest/swatches/Swatch-class.html)\ninterface represents a collection of related colors such as:\n\n- shades of grey;\n- the color gradient of a brand;\n- a user's preferred colors.\n\nIts single property `colors` retrieves several colors at once as an\n`Iterable\u003cColor\u003e` object.\n\nExcept for the _White_ and _Black_ classes, there is always a corresponding\n\"plural\" class for each color class — accent colors included — that implements\nthe _Swatch_ interface. For example, the command `Greys().colors` retrieves 10\nshades of grey; the higher the index, the darker the color.\n\nFor a red color gradient:\n\n```dart\n/// a color gradient of 10 shades of red.\nfinal Iterable\u003cColor\u003e theReds = Reds().colors;\n```\n\nFor a complete list of color swatches:\n\n- [swatches](https://pub.dev/documentation/eo_color/latest/swatches/swatches-library.html)\n\n### Swatch in action\n\nThe following code provides a fully working example. It creates a rectangle\nwidget filled with a color gradient provided by the _swatch_ instance.\n\n```dart\nimport 'package:eo_color/swatches.dart';\nimport 'package:flutter/material.dart';\n\n/// Rectangle filled with a gradient of ten shades of a Material Design color.\nclass RectGradient extends StatelessWidget {\n  /// Rectangle filled with the given color swatch.\n  const RectGradient(Swatch swatch, {Key? key})\n      : _swatch = swatch,\n        super(key: key);\n\n  /// Rectangle filled with ten shades of grey.\n  const RectGradient.grey({Key? key}) : this(const Greys(), key: key);\n\n  // Material Design color swatch.\n  final Swatch _swatch;\n\n  @override\n  Widget build(BuildContext context) {\n    return Container(\n      height: kToolbarHeight / 2,\n      decoration: BoxDecoration(\n        gradient: LinearGradient(\n          end: Alignment.bottomLeft,\n          begin: Alignment.topRight,\n          colors: _swatch.colors.toList(growable: false),\n        ),\n      ),\n    );\n  }\n}\n```\n\n## Gradient interface\n\nIt represents a range of position-dependent colors, usually used to fill a\nregion. The colors produced by a gradient vary continuously with position,\nproducing smooth color transitions.\n\nWhile the\n[Swatch](https://pub.dev/documentation/eo_color/latest/swatches/Swatch-class.html)\ninterface retrieves an `iterable\u003cColors\u003e` object, subclasses of\n[Gradient](https://pub.dev/documentation/eo_color/latest/gradients/Gradient-class.html)\nretrieves a `List\u003cColors\u003e`, which makes them better suited for dealing with\nFlutter's gradient APIs — these APIs almost always expects a `List\u003cColor\u003e`\nobject as the parameter rather than an `Iterable\u003cColor\u003e` object.\n\nFor Material Design color gradients, use the\n[GradOf](https://pub.dev/documentation/eo_color/latest/gradients/GradOf-class.html)\nclass, which in turn implements the\n[Gradient](https://pub.dev/documentation/eo_color/latest/gradients/Gradient-class.html)\ninterface. Another example of a `Gradient` implementation is the abstract class\n`GradientImmut`, which retrieves immutable `List\u003cColors\u003e` objects.\n\n\nFor a complete list of gradients:\n\n- [gradients\n  library](https://pub.dev/documentation/eo_color/latest/gradients/gradients-library.html)\n\n## Demo application\n\nThe demo application provides a fully working example, focused on demonstrating\nexactly three color palettes in action: **BlueGrey**, **Grey**, and **Brown**.\nYou can take the code in this demo and experiment with it.\n\nTo run the demo application:\n\n```shell\ngit clone https://github.com/dartoos-dev/eo_color.git\ncd eo_color/example/\nflutter run -d chrome\n```\n\nThis should launch the demo application on Chrome in debug mode.\n\n![Demo-App](https://user-images.githubusercontent.com/24878574/122656689-440a6000-d133-11eb-9100-46d6ff344283.png)\n\n## Contribute\n\nContributors are welcome!\n\n1. Open an issue regarding an improvement, a bug you noticed, or ask to be\n   assigned to an existing one.\n2. If the issue is confirmed, fork the repository, do the changes on a separate\n   branch and make a _Pull Request_.\n3. After review and acceptance, the _Pull Request_ is merged and closed.\n\nMake sure the command below **passes** before making a Pull Request.\n\n```shell\n  flutter analyze \u0026\u0026 flutter test\n```\n\n## References\n\n- [material design color palette](https://material.io/archive/guidelines/style/color.html#color-color-palette).\n- [color-gradient](https://en.wikipedia.org/wiki/Color_gradient)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartoos-dev%2Feo_color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdartoos-dev%2Feo_color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartoos-dev%2Feo_color/lists"}