{"id":15716217,"url":"https://github.com/zymulator/chromabrew","last_synced_at":"2026-02-13T18:33:05.571Z","repository":{"id":51971083,"uuid":"184210220","full_name":"Zymulator/chromabrew","owner":"Zymulator","description":"🌈 Beer color prediction, conversion, and output for the web 🍺","archived":false,"fork":false,"pushed_at":"2025-02-19T19:30:13.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T21:24:26.662Z","etag":null,"topics":["barry","beer","brew","color","daniels","ebc","hex","lovibond","mcu","morey","mosher","srm","wow"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Zymulator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-04-30T07:07:32.000Z","updated_at":"2025-02-19T19:30:12.000Z","dependencies_parsed_at":"2024-10-24T13:09:24.819Z","dependency_job_id":"531c2e96-5bd6-4091-94d2-7fd6bc74abfe","html_url":"https://github.com/Zymulator/chromabrew","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.2666666666666667,"last_synced_commit":"b514f5621672069654b2fe7679462f83bc1d4bb9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Zymulator/chromabrew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zymulator%2Fchromabrew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zymulator%2Fchromabrew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zymulator%2Fchromabrew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zymulator%2Fchromabrew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zymulator","download_url":"https://codeload.github.com/Zymulator/chromabrew/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zymulator%2Fchromabrew/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274385041,"owners_count":25275380,"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-09T02:00:10.223Z","response_time":80,"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":["barry","beer","brew","color","daniels","ebc","hex","lovibond","mcu","morey","mosher","srm","wow"],"created_at":"2024-10-03T21:44:31.641Z","updated_at":"2026-02-13T18:33:00.549Z","avatar_url":"https://github.com/Zymulator.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chromabrew\n\nConvert SRM, EBC, or a list of Lovibond values to another color scale, or to a hex color.\n\nColor values are provided by Barley Dog Brewery [here](https://www.barleydogbrewery.com/xml/colors.xml).\n\n## Usage\n\nInstall the library:\n\n```\nnpm install --save chromabrew\n```\n\nRequire the module:\n\n```javascript\nlet chromabrew = require('chromabrew');\n```\n\nPass options which describe a batch to the `Batch` constructor, or directly to the required module.  See the list of accepted options below.  Call `hex` on the returned object to get a color:\n\n```javascript\nnew chromabrew.Batch({ srm: 4 }).hex();\n// =\u003e '#ECE61A'\n\nchromabrew({ srm: 4 }).hex();\n// =\u003e '#ECE61A'\n\nchromabrew({ ebc: 4 }).hex();\n// =\u003e '#F8F753'\n```\n\nConvert between color scales:\n\n```javascript\nlet batch = chromabrew({ srm: 4 });\n\nbatch.srm();\n// =\u003e 4\n\nbatch.ebc();\n// =\u003e 7.88\n\nbatch.mcu();\n// =\u003e 4.210535199414287\n\nbatch.lovibond();\n// =\u003e 3.407407407407407\n```\n\nSpecify which calculation method was used to determine the provided `srm` or `ebc`, or which method to use when converting between scales:\n\n```javascript\nlet batch = chromabrew({ srm: 14, calculator: 'daniels' });\n\nbatch.srm('daniels');\n// =\u003e 14\n\n// defaults to 'morey'\nbatch.srm();\n// =\u003e 14.670088349307665\n\nbatch.srm('mosher');\n// =\u003e 13.099999999999998\n\n// defaults to 'morey'\nbatch.ebc();\n// =\u003e 28.9000740481361\n\nbatch.hex('daniels');\n// =\u003e '#B26033'\n\n// defaults to 'morey'\nbatch.hex();\n// =\u003e '#A85C37'\n```\n\n### Options\n\n#### Primary Options\n\nAny one of the following options must be passed to the module:\n\n| option | description | type |\n|-|-|-|\n| `srm` | the SRM of a batch | `Number` |\n| `ebc` | the EBC of a batch | `Number` |\n| `l` or `lovibond` | the degrees Lovibond of a batch | `Number` |\n| `batch` | options describing a batch in detail **(see below)** | `Object` |\n\nThis option may be used in combination with a known color value (`srm`, `ebc`, or `l`) to specify which calculation method was used:\n\n| option | description | type |\n|-|-|-|\n| `calculator` | the SRM calculation method used: `'morey'` **(default)**, `'daniels'`, `'mosher'`, or `'barry'` † | `String` |\n\n† apparently they let anyone create a beer color scale\n\n#### Batch Options\n\nThe following options define the `batch` primary option:\n\n| option | description | type |\n|-|-|-|\n| `mcu` | the MCU of the batch, if it is already known | `Number` |\n| `v` or `volume` | the total liquid volume of the wort **(required)** | `Number` |\n| `ingredients` | an `Array` of ingredient options **(see below; required)** | `Array[Object]` |\n| `litres` or `liters` | whether `volume` is expressed in litres | `Boolean` |\n| `kilograms` or `kilos` | whether `weight` of each item in `ingredients` is expressed in kilograms | `Boolean` |\n| `metric` | shortcut to apply both `litres` and `kilograms` options | `Boolean` |\n\n#### Ingredient Options\n\nThe following options define each ingredient in the `ingredients` batch option:\n\n| option | description | type |\n|-|-|-|\n| `l` or `lovibond` | the value in degrees Lovibond of the ingredient  **(required)** | `Number` |\n| `w` or `weight` | the weight of the ingredient used **(required)** | `Number` |\n\n### Functional Domain\n\nThe domain of valid inputs is 0 through 40 SRM.  Input values are rounded to the nearest 0.1 SRM within this domain:\n\n```javascript\nchromabrew({ srm: -1 }).hex() === chromabrew({ srm: 0 }).hex();\n// =\u003e true\n\nchromabrew({ srm: Number.MAX_VALUE }).hex() === chromabrew({ srm: 40 }).hex();\n// =\u003e true\n\nchromabrew({ srm: Math.PI }).hex() === chromabrew({ srm: 3.1 }).hex();\n// =\u003e true  \n```\n\nThe `'daniels'` and `'mosher'` SRM calculation scales have a minimum result of `8.4` and `4.7`, respectively.  Where a provided `srm` would result in a negative `mcu`, the `mcu` is set to 0:\n\n```javascript\nlet daniels = chromabrew({ srm: 4, calculator: 'daniels' });\n\ndaniels.mcu();\n// =\u003e 0\n\ndaniels.srm();\n// =\u003e 0\n\ndaniels.srm('daniels');\n// =\u003e 8.4\n\nlet mosher = chromabrew({ srm: 4, calculator: 'mosher' });\n\nmosher.mcu();\n// =\u003e 0\n\nmosher.srm();\n// =\u003e 0\n\nmosher.srm('mosher');\n// =\u003e 4.7\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzymulator%2Fchromabrew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzymulator%2Fchromabrew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzymulator%2Fchromabrew/lists"}