{"id":18021367,"url":"https://github.com/2mol/elm-colormaps","last_synced_at":"2025-03-26T22:30:50.738Z","repository":{"id":57674512,"uuid":"114249757","full_name":"2mol/elm-colormaps","owner":"2mol","description":"Colormaps in Elm.","archived":false,"fork":false,"pushed_at":"2018-09-05T15:09:57.000Z","size":233,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T14:22:25.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://2mol.github.io/elm-colormaps/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2mol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-14T12:47:15.000Z","updated_at":"2019-03-12T06:15:25.000Z","dependencies_parsed_at":"2022-08-29T17:41:04.163Z","dependency_job_id":null,"html_url":"https://github.com/2mol/elm-colormaps","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2mol%2Felm-colormaps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2mol%2Felm-colormaps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2mol%2Felm-colormaps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2mol%2Felm-colormaps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2mol","download_url":"https://codeload.github.com/2mol/elm-colormaps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245747490,"owners_count":20665798,"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-30T06:09:38.266Z","updated_at":"2025-03-26T22:30:50.457Z","avatar_url":"https://github.com/2mol.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elm Colormaps\n\n`elm-colormaps` is a collection of high-quality colormaps intended for data visualization and scientific plotting.\n\nFor now it mainly provides a port of the five sequential colormaps (magma, inferno, plasma, viridis, and cividis) that are included in newer versions of matplotlib. These are perceptually uniform, colorblind friendly and can be printed out in grayscale with minimal loss of information.\n\n![magma, inferno, plasma, viridis, and cividis](https://raw.githubusercontent.com/2mol/elm-colormaps/master/images/matplotlib.png)\n\nThis library provides these colormaps as functions of type `Float -\u003e Color`, where the input is expected to be between 0 and 1.\n\nTo use, just import `Color.Colormaps` and use the functions `magma`, `inferno`, `plasma`, `viridis`, and `cividis`.\n\n## Interop with elm-css\n\nSince `elm-css` currently has a different Color type than the Base library, colors from `Colormap` have to be converted. To keep dependencies to a minimum, `elm-colormaps` does not ship with a conversion function. However, it can easily be written as follows:\n\n```elm\ncolorCoreToCss : Color.Color -\u003e Css.Color\ncolorCoreToCss c =\n    let\n        { red, green, blue, alpha } =\n            Color.toRgb c\n    in\n        Css.rgba red green blue alpha\n```\n\n## Examples and custom colormaps\n\nThe `examples` directory contains code illustrating all abovementioned functionality. Run the code locally with `elm-reactor` and open `Example.elm`. Alternatively, take a look at the results at [https://2mol.github.io/elm-colormaps/](https://2mol.github.io/elm-colormaps/).\n\nThere are also examples included about how to use the various helper functions that can be used to define custom colormaps from lists of RGB tuples.\n\n## References\n\nThe original exposition on why and how the new Matplotlib colormaps were created. Highly recommended:\n\nhttps://bids.github.io/colormap/\n\nSome more information on the linearity of several colormaps, as well as some additional ones that might be interesting to port to Elm in the future:\n\nhttps://matplotlib.org/users/colormaps.html\n\nhttps://matplotlib.org/gallery/color/colormap_reference.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2mol%2Felm-colormaps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2mol%2Felm-colormaps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2mol%2Felm-colormaps/lists"}