{"id":22711160,"url":"https://github.com/hesham04dev/color_merge","last_synced_at":"2025-03-29T21:43:40.946Z","repository":{"id":265202662,"uuid":"895443888","full_name":"hesham04Dev/color_merge","owner":"hesham04Dev","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T11:35:46.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T22:29:57.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/hesham04Dev.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":"2024-11-28T08:14:07.000Z","updated_at":"2024-12-02T11:35:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b57c2cd-e963-4cb8-bb56-6efe12b53546","html_url":"https://github.com/hesham04Dev/color_merge","commit_stats":null,"previous_names":["hesham04dev/color_merge"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fcolor_merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fcolor_merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fcolor_merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fcolor_merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hesham04Dev","download_url":"https://codeload.github.com/hesham04Dev/color_merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246249227,"owners_count":20747167,"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","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":[],"created_at":"2024-12-10T12:14:39.491Z","updated_at":"2025-03-29T21:43:40.941Z","avatar_url":"https://github.com/hesham04Dev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u003cimg src=\"https://raw.githubusercontent.com/hesham04Dev/color_merge/refs/heads/main/screenshots/logo.png\" width=\"30px\"/\u003e  **color_merge**\n\nA lightweight Flutter package that provides **color merging utilities** for blending colors seamlessly. It allows developers to simulate the effect of stacking colors on top of one another, ignoring opacity, and adapt colors dynamically based on the app's theme.\n\n---\n\n## ✨ **Features**\n\n- 🎨 **Merge Colors**: Blend two colors to simulate stacking, producing a fully opaque result.  \n- ⚪ **White Merge**: Simplified method to merge a color with white.  \n- ⚫ **Black Merge**: Simplified method to merge a color with black.  \n\n---\n\n## 🚀 **Installation**\n\nAdd `color_merge` to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  color_merge: ^1.0.0\n```\n\nThen, run:\n\n```bash\nflutter pub get\n```\n\n---\n\n## 🛠️ **Usage**\n\n### 🔄 Merge Two Colors\nBlend two colors to simulate the effect of stacking one on top of another:\n\n#### Traditional Way\nRequires wrapping with a container to achieve the desired effect:\n\n```dart\nContainer(\n  width: 50,\n  height: 50,\n  color: Colors.white,\n  child: Container(\n    color: Colors.purple.withOpacity(0.5),\n  ),\n);\n```\n\n#### **color_merge** Way\nAchieve the same effect in a simpler, cleaner way:\n\n```dart\nContainer(\n  width: 50,\n  height: 50,\n  color: Colors.purple.withOpacity(0.5).merge(Colors.white),\n);\n```\n\n---\n\n### ⚪ **White Merge** \u0026 ⚫ **Black Merge**\nEasily merge colors with `Colors.white` or `Colors.black`:\n\n```dart\nfinal color = Colors.green.withOpacity(0.3);\n\n// Merge with white\nfinal whiteMerged = color.whiteMerge();\n\n// Merge with black\nfinal blackMerged = color.blackMerge();\n```\n\n---\n\n## 📖 **Methods**\n\n### 🔹 `Color.merge(Color otherColor)`\nBlends the current color with another color, producing a new fully opaque color. \n\n#### Example:\n```dart\nfinal baseColor = Colors.white;\nfinal overlayColor = Colors.red.withOpacity(0.5);\n\nfinal result = overlayColor.merge(baseColor);\n```\n\n#### Result:\nIf `overlayColor` is `Colors.red.withOpacity(0.5)` and `baseColor` is `Colors.white`, the resulting color will be a fully opaque blend of the two.\n\n\u003e **Note**: The merging only works when the current color has an opacity less than 1.0.  \n\n---\n\n## 📜 **License**\n\nThis package is available under the **MIT License**. Feel free to use it in personal or commercial projects.\n\n---\n\n## 🤝 **Contributions**\n\nContributions are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request.  \n\n---\n\n## 👤 **Author**\n\nDeveloped by **Hisham**.  \nFeel free to reach out for support, feedback, or collaboration!\n\n---\n\n## 🔗 Links\n\n- [GitHub Repository](#https://github.com/hesham04Dev/color_merge)  \n- [Pub.dev Package](#)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhesham04dev%2Fcolor_merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhesham04dev%2Fcolor_merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhesham04dev%2Fcolor_merge/lists"}