{"id":19675270,"url":"https://github.com/opengems/rails_dominant_colors","last_synced_at":"2025-07-17T17:36:05.082Z","repository":{"id":56890522,"uuid":"260789687","full_name":"OpenGems/rails_dominant_colors","owner":"OpenGems","description":"Extract the dominant color(s) from an image (remote image, locally image, base64 image etc...)","archived":false,"fork":false,"pushed_at":"2024-08-09T12:09:24.000Z","size":383,"stargazers_count":16,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T23:46:55.027Z","etag":null,"topics":["convert-images","hex-color","histogram-filters","hsl-color","image-histogram","imagemagick","rails","rgb-color","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/OpenGems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-05-02T22:55:06.000Z","updated_at":"2024-09-26T00:34:57.000Z","dependencies_parsed_at":"2024-08-09T13:35:00.947Z","dependency_job_id":"2541a2fb-ac5e-4541-8a13-58d8e869d2b7","html_url":"https://github.com/OpenGems/rails_dominant_colors","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"3952c7200f108b80acf376fe68459ab19d053286"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenGems%2Frails_dominant_colors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenGems%2Frails_dominant_colors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenGems%2Frails_dominant_colors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenGems%2Frails_dominant_colors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenGems","download_url":"https://codeload.github.com/OpenGems/rails_dominant_colors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810273,"owners_count":21807759,"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":["convert-images","hex-color","histogram-filters","hsl-color","image-histogram","imagemagick","rails","rgb-color","ruby"],"created_at":"2024-11-11T17:22:40.775Z","updated_at":"2025-05-07T04:11:13.151Z","avatar_url":"https://github.com/OpenGems.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RailsDominantColors\n\n[![Gem Version](https://badge.fury.io/rb/rails_dominant_colors.svg)](https://badge.fury.io/rb/rails_dominant_colors)\n[![Maintainability](https://api.codeclimate.com/v1/badges/83326d81b9112b45768f/maintainability)](https://codeclimate.com/github/OpenGems/rails_dominant_colors/maintainability)\n[![Build Status](https://travis-ci.org/OpenGems/rails_dominant_colors.svg?branch=master)](https://travis-ci.org/OpenGems/rails_dominant_colors)\n[![security](https://hakiri.io/github/OpenGems/rails_dominant_colors/master.svg)](https://hakiri.io/github/OpenGems/rails_dominant_colors/master)\n![Gem](https://img.shields.io/gem/dt/rails_dominant_colors)\n[![Coverage Status](https://coveralls.io/repos/github/OpenGems/rails_dominant_colors/badge.svg?branch=master)](https://coveralls.io/github/OpenGems/rails_dominant_colors?branch=master)\n\nA Ruby gem for extract the dominant color(s) from an image (remote image, locally image, base64 image etc...)\n\nGet HEX(A) color(s), RGB(A) color(s) and HSL(A) color(s)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rails_dominant_colors'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install rails_dominant_colors\n\n## Usage\n\n```ruby\ncolors = 5 # Optional, number of colors (default: 5)\n\ndominant_colors = RailsDominantColors::Base64.new('data:image/png;base64,awesome-image', colors)\n\n# or\n\nRailsDominantColors::Url.new('https://awesome-url.com/awesome-image.png', colors)\n\n# or\n\nRailsDominantColors::Path.new('/awesome/path/awesome-image.png', colors)\n\n# and\n\ndominant_colors.to_hex # =\u003e [\"#FF007F\", \"#000000\", \"#1C000F\", \"#A0004F\", \"#000000\"]\ndominant_colors.to_hex_alpha # =\u003e [\"#FF007FFF\", \"#00000000\", \"#1C000FFE\", \"#A0004FFF\", \"#0000005F\"]\n\ndominant_colors.to_rgb # =\u003e [[255, 0, 127], [0, 0, 0], [28, 0, 15], [160, 0, 79], [0, 0, 0]]\ndominant_colors.to_rgb_alpha # =\u003e [[255, 0, 127, 1.0], [0, 0, 0, 0.0], [28, 0, 15, 1.0], [160, 0, 79, 1.0], [0, 0, 0, 0.37]]\n\ndominant_colors.to_hsl # =\u003e [[330, 100, 50], [0, 0, 0], [328, 100, 5], [330, 100, 31], [0, 0, 0]]\ndominant_colors.to_hsl_alpha # =\u003e [[330, 100, 50, 1.0], [0, 0, 0, 0.0], [328, 100, 5, 1.0], [330, 100, 31, 1.0], [0, 0, 0, 0.37]]\n\n# Awesome bonus\ndominant_colors.to_pct # =\u003e [52.16, 37.45, 9.93, 0.35, 0.1]\n\n```\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/OpenGems/rails_dominant_colors. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengems%2Frails_dominant_colors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopengems%2Frails_dominant_colors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopengems%2Frails_dominant_colors/lists"}