{"id":15406899,"url":"https://github.com/dannyben/colorly","last_synced_at":"2025-04-18T03:14:53.831Z","repository":{"id":46463905,"uuid":"377756805","full_name":"DannyBen/colorly","owner":"DannyBen","description":"Command Line Color Palette Generator","archived":false,"fork":false,"pushed_at":"2024-02-23T09:10:36.000Z","size":142,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T14:12:04.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/DannyBen.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}},"created_at":"2021-06-17T08:21:13.000Z","updated_at":"2023-11-29T12:12:57.000Z","dependencies_parsed_at":"2024-02-23T10:28:34.831Z","dependency_job_id":"fc4094b2-9669-44c5-8bda-84f4bed031f3","html_url":"https://github.com/DannyBen/colorly","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"c7a74efea560cf0a332ca241f05cc84322b13670"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fcolorly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fcolorly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fcolorly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Fcolorly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/colorly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249419085,"owners_count":21268560,"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-10-01T16:26:06.789Z","updated_at":"2025-04-18T03:14:53.812Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Colorly - Command Line Color Palette Generator\n\n[![Gem Version](https://badge.fury.io/rb/colorly.svg)](https://badge.fury.io/rb/colorly)\n[![Build Status](https://github.com/DannyBen/colorly/workflows/Test/badge.svg)](https://github.com/DannyBen/colorly/actions?query=workflow%3ATest)\n[![Maintainability](https://api.codeclimate.com/v1/badges/a708b1651a6caf451d53/maintainability)](https://codeclimate.com/github/DannyBen/colorly/maintainability)\n\n---\n\nColorly is a command line utility and a Ruby library for generating color\npalettes using a simple DSL.\n\nIt is a thin wrapper around the [chroma] gem.\n\nThe colorly command line outputs the palette as JSON, YAML or HTML.\n\n---\n\n## Install\n\n```\n$ gem install colorly\n```\n\n## Example\n\nColorly provides you with a simple ruby-based DSL for generating a color palette.\n\nStart by creating this file:\n\n```ruby\n# sample.rb\ntitle \"Set 1\"\nadd 'red'.lighten 20\nadd last.spin 60\nadd last.spin 60\n```\n\nthen run it by calling:\n\n```\n$ colorly sample.rb output.html\n```\n\noutput:\n\n![](assets/readme-sample-1.png)\n\nFor more detailed examples, view the [examples folder](examples).\n\n\n## Usage \n\nColorly scripts are built with a minimalist set of Ruby commands (DSL):\n\n```ruby\n# Start a new color set\ntitle \"Any unique name for this set\"\n\n# Add colors to this set\nadd 'yellow'.darken(10).desaturate(10)\nadd last.spin 20\n\n# Start another set\ntitle \"New set\"\nadd '#ff3344'\n# ...\n```\n\nThe colors provided to the `add` command can be\n[anything that is supported by `Chroma`](https://github.com/jfairbank/chroma#creating-colors),\nor an array of the same.\n\nIn addition, you can call the below `Chroma` methods directly on any color.\nThey will be forwarded to `Chroma`:\n\n```ruby\n'red'.spin        # same as 'red'.paint.spin\n'red'.brighten    # same as 'red'.paint.brighten\n'red'.darken      # same as 'red'.paint.darken \n'red'.lighten     # same as 'red'.paint.lighten \n'red'.saturate    # same as 'red'.paint.saturate \n'red'.desaturate  # same as 'red'.paint.desaturate \n'red'.greyscale   # same as 'red'.paint.greyscale (also grayscale)\n'red'.palette     # same as 'red'.paint.palette\n```\n\nYou can use the last added color with the variable `last`, and generate a\nrandom color by calling `random`:\n\n```ruby\ntitle \"Example\"\nadd 'red'.spin 10\nadd last.spin 30\nadd last.spin 30\nadd random.desaturate 10\n```\n\n## Using from Ruby code\n\nIf you wish to use Colorly from your own Ruby code, simply load a script to \nthe Script class:\n\n```ruby\nrequire 'colorly'\n\n# Load from a file\nscript = Colorly::Script.load 'script_file.rb'\n\n# ... or from a string\nscript_string = \"title 'Hello'; add params[:base_color] ; add last.spin 90\"\nscript = Colorly::Script.new script_string\n\n# Optionally, pass parameters to the script, which you can use in the script\n# by accessing the `params` hash.\nscript.params = { base_color: '#cdc' }\n# or\nscript.params[:base_color] = '#cdc'\n\n# Run it\nscript.run\n\n# Get its output - each color is a Chroma::Color object\np script.output\np script.output[\"Hello\"].first.class\n#=\u003e {\"Hello\"=\u003e[#ff2b00, #ff5500]}\n#=\u003e Chroma::Color\n\n# Get a simplified output where each color is just its hex string\np script.simple_output\n#=\u003e {\"Hello\"=\u003e[\"#ff2b00\", \"#ff5500\"]}\n\n# Get a simplified output, including color names (slower)\n# Get a simplified output, including color names (slower)\npp script.simple_output names: true\n#=\u003e {\"Hello\"=\u003e\n#=\u003e   [{:hex=\u003e\"#ff2b00\", :name=\u003e[\"Scarlet\", \"Red\"]},\n#=\u003e    {:hex=\u003e\"#ff5500\", :name=\u003e[\"International Orange\", \"Orange\"]}]}\n```\n\n## Contributing / Support\n\nIf you experience any issue, have a question or a suggestion, or if you wish\nto contribute, feel free to [open an issue][issues].\n\n## Credits\n\n- [Jeremy Fairbank](https://github.com/jfairbank) for the [chroma] gem.\n- [Chirag Mehta](https://chir.ag/) for the original Javascript [color naming functions](https://chir.ag/projects/name-that-color).\n- [Colblindor](https://www.color-blindness.com/color-name-hue/) for the additional base color (shade) work.\n\n\n\n---\n\n[chroma]: https://github.com/jfairbank/chroma\n[issues]: https://github.com/DannyBen/colorly/issues","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fcolorly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Fcolorly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Fcolorly/lists"}