{"id":16931344,"url":"https://github.com/leodido/material-palette","last_synced_at":"2025-03-22T11:31:22.389Z","repository":{"id":42614548,"uuid":"56521953","full_name":"leodido/material-palette","owner":"leodido","description":"Generates material palettes for your colors","archived":false,"fork":false,"pushed_at":"2019-12-21T20:40:59.000Z","size":67,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:04:20.842Z","etag":null,"topics":["javascript","material","material-colors","material-palette"],"latest_commit_sha":null,"homepage":null,"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/leodido.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}},"created_at":"2016-04-18T16:00:43.000Z","updated_at":"2023-08-23T11:25:38.000Z","dependencies_parsed_at":"2022-09-26T16:22:25.548Z","dependency_job_id":null,"html_url":"https://github.com/leodido/material-palette","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Fmaterial-palette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Fmaterial-palette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Fmaterial-palette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodido%2Fmaterial-palette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leodido","download_url":"https://codeload.github.com/leodido/material-palette/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951437,"owners_count":20537385,"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":["javascript","material","material-colors","material-palette"],"created_at":"2024-10-13T20:43:46.378Z","updated_at":"2025-03-22T11:31:21.899Z","avatar_url":"https://github.com/leodido.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cimg width=\"500\" src=\"https://cdn.rawgit.com/leodido/material-palette/develop/media/logo.png\" alt=\"Material Palette Generator\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\u003c/h1\u003e\n\n[![CI](https://img.shields.io/travis/leodido/material-palette/master.svg?style=flat-square)][ci] [![NPM](https://img.shields.io/npm/v/material-palette.svg?style=flat-square)][npm] [![Coveralls branch](https://img.shields.io/coveralls/leodido/material-palette/master.svg?style=flat-square)][coveralls]\n\n\u003e **Generates material palettes for your colors**\n\nGiven an input color it calculates its palette approaching the logic of **[Google Material Design Color Palettes][mdpalettes]**.\n\n**Since the algorithm behind their generation is not (yet) known this module approximates the colors values**.\n\nIt works everywhere: browsers, node, and so on.\n\n## Install\n\nWith **[npm][npm]** do:\n\n```\nnpm install material-palette\n```\n\n## API\n\nThis module exports a single function, the material palette generator.\n\n### `materialpalette({ h: number, s: number, l: number })`\n\n- It takes an object containing the h, s, and l fields\n\n    - The field **h** must be a numeric into **[0, 360]**.\n\n    - The fields **s** and **l** must be numerics into **[0, 100]**.\n\n- It returns an object containing all the 14 palette variants (e.g., 50, 100, 200, ..., A700)\n\nAs always, more details **reading the [tests](test.js)** ...\n\n## Example\n\nSuppose you want to generate a material palette for **hsl(87, 100%, 22%)** color (i.e. **#3E7000**).\n\nFirst of all import the generator.\n\n```javascript\nvar materialpalette = require('materialpalette') // node\nimport materialpalette from 'materialpalette' // ES2015\nwindow.materialpalette // browsers\n```\n\nThen use it.\n\n```javascript\nvar ciao = materialpalette({ h: 87, s: 100, l: 22 })\n```\n\nWhich results in the following object ...\n\n```javascript\n{\n  '50': { h: 87, s: 100, l: 74 },\n  '100': { h: 87, s: 100, l: 59 },\n  '200': { h: 87, s: 100, l: 48 },\n  '300': { h: 87, s: 100, l: 34 },\n  '400': { h: 87, s: 100, l: 28 },\n  '500': { h: 87, s: 100, l: 22 },\n  '600': { h: 87, s: 100, l: 16 },\n  '700': { h: 87, s: 100, l: 10 },\n  '800': { h: 87, s: 100, l: 4 },\n  '900': { h: 87, s: 100, l: 0 },\n  'A100': { h: 92, s: 100, l: 46 },\n  'A200': { h: 92, s: 100, l: 38 },\n  'A400': { h: 92, s: 100, l: 21 },\n  'A700': { h: 92, s: 100, l: 10 }\n}\n```\n\nMatching, visually ...\n\n![Material Colors Palette for #3E7000](palette-3e7000.png)\n\nIt's cool, isn't it?\n\n## License\n\nMIT © Leonardo Di Donato\n\n---\n\n[![Analytics](https://ga-beacon.appspot.com/UA-49657176-1/material-palette?flat)](https://github.com/igrigorik/ga-beacon)\n\n[npm]:        https://npmjs.org/package/material-palette\n[ci]:         https://travis-ci.org/leodido/material-palette\n[coveralls]:  https://coveralls.io/r/leodido/material-palette?branch=master\n[mdpalettes]: https://www.google.com/design/spec/style/color.html#color-color-palette\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodido%2Fmaterial-palette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleodido%2Fmaterial-palette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodido%2Fmaterial-palette/lists"}