{"id":30873553,"url":"https://github.com/lllisteu/redgreenblue","last_synced_at":"2025-09-07T23:11:36.762Z","repository":{"id":56891425,"uuid":"190003381","full_name":"lllisteu/redgreenblue","owner":"lllisteu","description":"A simple Ruby library for handling RGB colors.","archived":false,"fork":false,"pushed_at":"2024-08-07T08:33:45.000Z","size":328,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-28T17:09:58.203Z","etag":null,"topics":["cie","color","colour","gif","graphics","hsb","hsl","hsv","ostwald","philips-hue","rgb","rgb565"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"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/lllisteu.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2019-06-03T12:44:02.000Z","updated_at":"2024-08-07T08:33:48.000Z","dependencies_parsed_at":"2024-02-07T17:02:02.148Z","dependency_job_id":null,"html_url":"https://github.com/lllisteu/redgreenblue","commit_stats":{"total_commits":361,"total_committers":2,"mean_commits":180.5,"dds":"0.0027700831024930483","last_synced_commit":"68bb15732e2c8f9a41dcc8fbd21f59c495504064"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/lllisteu/redgreenblue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lllisteu%2Fredgreenblue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lllisteu%2Fredgreenblue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lllisteu%2Fredgreenblue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lllisteu%2Fredgreenblue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lllisteu","download_url":"https://codeload.github.com/lllisteu/redgreenblue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lllisteu%2Fredgreenblue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274107977,"owners_count":25223473,"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-07T02:00:09.463Z","response_time":67,"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":["cie","color","colour","gif","graphics","hsb","hsl","hsv","ostwald","philips-hue","rgb","rgb565"],"created_at":"2025-09-07T23:11:33.968Z","updated_at":"2025-09-07T23:11:36.748Z","avatar_url":"https://github.com/lllisteu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[GitHub](https://github.com/lllisteu/redgreenblue) • [RubyGems](https://rubygems.org/gems/redgreenblue) • [Documentation](https://www.rubydoc.info/gems/redgreenblue/RGB) • [History](History.md) •  [Archive](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/lllisteu/redgreenblue)\n\n# redgreenblue\n\nredgreenblue is a simple [Ruby](https://www.ruby-lang.org/) library for handling [RGB colors](https://en.wikipedia.org/wiki/RGB_color_model).\n\nIt lets you express RGB colors as 24-bit triplets, 48-bit triplets, fractions, or hexadecimal notation, as well as [HSL, HSB, or HSV](https://en.wikipedia.org/wiki/HSL_and_HSV) (hue, saturation, and lightness, brightness, or value), and has 148 named CSS colors built-in.\n\n\u003cimg width=\"600\" height=\"258\" alt=\"IRB screenshot\" src='docs/images/irb_screenshot.png'\u003e\n\n redgreenblue can output RGB colors as [CIE](https://en.wikipedia.org/wiki/CIE_1931_color_space) XYZ or xyY coordinates, L\\*a\\*b\\*, L\\*u\\*v\\*, and their cylindrical representations LCHab and LCHuv.\n\nIf your terminal supports \"[true color](https://github.com/termstandard/colors)\", redgreenblue's colorised inspect styles will display your colors in 24-bit splendour, right in the terminal.\n\nredgreenblue can create 1-pixel GIF's from any color and also understands some more exotic formats, such as 16-bit RGB565 and 24-bit BGR. On a Mac it can interact with the system color picker.\n\n## Installing\n\nredgreenblue is [available as a gem](https://rubygems.org/gems/redgreenblue). You can simply install it with:\n\n```bash\ngem install redgreenblue\n```\n\nredgreenblue has no dependencies outside the Ruby Standard Library, and works with Ruby 2.2 or newer.\n\n## Quick start\n\nLet's create an RGB color:\n\n```ruby\nrequire 'redgreenblue'\n=\u003e true\npink = RGB.hex('ff99cc')\n=\u003e RGB #ff99cc (red=1.00000 green=0.60000 blue=0.80000)\npink.class\n=\u003e RGB::Color\n```\n\nThere are many ways to create `RGB::Color` objects.\n\nThese six examples will create the exact same color:\n\n```ruby\npink = RGB.hex('f9c')\npink = RGB.new(1, 0.6, 0.8)\npink = RGB.rgb(255, 153, 204)\npink = RGB.rrggbb(65535, 39321, 52428)\npink = RGB.hsl(330, 1, 0.8)\npink = RGB.hsv(330, 0.4, 1)\n```\n\nAn `RGB::Color` object can supply many pieces of information about itself.\n\nFor example:\n\n```ruby\npink.hex\n=\u003e \"ff99cc\"\npink.hex(true)\n=\u003e \"f9c\"\npink.values\n=\u003e [1.0, 0.6, 0.8]\npink.red\n=\u003e 1.0\npink.rgb\n=\u003e [255, 153, 204]\npink.r\n=\u003e 255\npink.rrggbb\n=\u003e [65535, 39321, 52428]\npink.hsl\n=\u003e [330.0, 1.0, 0.8]\npink.hsb\n=\u003e [330.0, 0.4, 1.0]\npink.hwb\n=\u003e [330.0, 0.6, 0.0]\npink.cie_xyz\n=\u003e [0.635314, 0.484064, 0.631122]\npink.cie_lab\n=\u003e [75.08050605, 44.58467493, -9.72046865]\n```\n\nRGB::Color objects can easily be changed: they are _mutable_:\n\n```ruby\nrose = RGB.red\n=\u003e RGB #ff0000 (red=1.00000 green=0.00000 blue=0.00000)\nrose.whiten!(0.6)\n=\u003e RGB #ff9999 (red=1.00000 green=0.60000 blue=0.60000)\nrose.hsl_rotate!(-30)\n=\u003e RGB #ff99cc (red=1.00000 green=0.60000 blue=0.80000)\nrose == pink\n=\u003e true\n```\n\n## Resources\n\n* [HSL and HSV](https://en.wikipedia.org/wiki/HSL_and_HSV) on Wikipedia\n* [_Photoshop by the Numbers: Color Coding_](https://geraldbakker.nl/psnumbers/color-coding/index.html), by Gerald Bakker\n* _Das ABC der Farbe_, by Markus Wäger (2017), ISBN 978-3-8362-4501-2\n* [Bruce Lindbloom](http://www.brucelindbloom.com/)\n* [_CIE 15: Technical Report: Colorimetry, 3rd edition_](https://archive.org/details/gov.law.cie.15.2004) (2004)\n* [_A Guided Tour of Color Space_](http://poynton.ca/PDFs/Guided_tour.pdf) (PDF), by [Charles Poynton](http://poynton.ca/) (1997)\n* _Color for the Sciences_, by Jan Koenderink (2010), ISBN 978-0-262-01428-1\n* _Color Ordered_, by Rolf Kuehni and Andreas Schwarz (2008), ISBN 978-0-19-518968-1\n* _Psychology_, by Henry Gleitman, James Gross, Daniel Reisberg (2010), ISBN 978-0-393-93250-8\n* _Interaction of Color_, by Josef Albers (1963), ISBN 978-0-300-17935-4\n* _配色事典 – A Dictionary of Color Combinations_, by Sanzo Wada (2010), ISBN 978-4-86152-247-5\n* _The Anatomy of Colour_, by Patrick Baty (2017), ISBN 978-0-500-51933-2\n* _Nature's Palette_, by Patrick Baty (2021), ISBN 978-0-500-25246-8\n* _Einführung in die Farbenlehre_, by Harald Küppers (2016), ISBN 978-3-8321-6403-4\n\n## Credits\n\nApart from the resources listed above, some discussions and answers on [Stack Overflow](https://stackoverflow.com) and [PerlMonks](https://www.perlmonks.org) were very helpful, as were some articles on [Wikipedia](https://en.wikipedia.org/). Many helpful sources of information are credited where applicable in the source code, often with a link.\n\nGamma- and CIE-processing in redgreenblue lean heavily on work by [Bruce Lindbloom](http://www.brucelindbloom.com/).\n\n## License\n\nSee the included [LICENSE.txt](LICENSE.txt) file.\n\n## Alternatives\n\n[Color](https://github.com/halostatue/color): a versatile Ruby color library.\n\n-----\n\n\u003cp align=center\u003e\n“The philosopher for whom rainbows can be explained away never saw them.”\n\u003c/p\u003e\n\n\u003cp align=center\u003e\nHenry David Thoreau, \u003ci\u003eJournal\u003c/i\u003e, 5 November 1857.\n\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flllisteu%2Fredgreenblue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flllisteu%2Fredgreenblue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flllisteu%2Fredgreenblue/lists"}