{"_id":"@artprompt/material-color-utilities","name":"@artprompt/material-color-utilities","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@artprompt/material-color-utilities","version":"0.2.0","description":"Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.","keywords":["material","material design","material3","material you","color extraction","theming"],"types":"./cjs/index.d.ts","exports":{".":{"import":"./esm/index.js","require":"./cjs/index.js"}},"repository":{"type":"git","url":"git+https://github.com/colelawrence/material-color-utilities.git","directory":"typescript"},"author":{"name":"Material Eng"},"license":"Apache-2.0","bugs":{"url":"https://github.com/colelawrence/material-color-utilities/issues"},"homepage":"https://github.com/colelawrence/material-color-utilities/tree/main/typescript","scripts":{"postinstall":"npm run build","remove-build":"rm -rf cjs esm","build":"npm run remove-build && tsc && tsc -p tsconfig.esm.json","watch":"tsc -w","prepublishOnly":"npm run build"},"devDependencies":{"@types/jasmine":"^3.10.3","@types/node":"^18.7.17","jasmine":"^4.0.2","typescript":"^4.5.5"},"gitHead":"9e7f494846873e00f4d6bf538674bda19f73e0f5","_id":"@artprompt/material-color-utilities@0.2.0","_nodeVersion":"18.5.0","_npmVersion":"8.12.1","dist":{"integrity":"sha512-rTz10j3tcHHEbp+KN0I6eBMws+t9N97dRYhuVKuUWtnBvVmTJNDrujntVCtyqkfbuzyJVkVDEwIgc0yCuquVBA==","shasum":"12a30485c487db3f6837f750fcf9a134d5c47de5","tarball":"https://registry.npmjs.org/@artprompt/material-color-utilities/-/material-color-utilities-0.2.0.tgz","fileCount":168,"unpackedSize":565239,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCiaCi5gnEtI6i2IqgGy1xgmk7H/fwVbBlJXNK9/xOMQIhAJ3pMm0ERbWa1/SNCwE10SJoC7P4jfeuW0IksTdVnu5f"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK23mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkeg//aSxIajqXkH3qvCLCPndhlP0gPrgQsdtw0fFhuZ0bt89D/LYu\r\n0NHyLKvUpksg3OWWVU6q2kl3PKiLXv0H4WVYegMKae6DfkEXq8TEt4juUmQ/\r\nuT+rW54H0Twb/xLc1mUsFK478beLGvkKZI+Bn0jW8DXFSs+8MstXuIUjW65B\r\n+e3Khtj/F5GW9PMwb8JD2PUYE2kbRRAXUH6TDBZz06DcOh1RfYUrXQDuYvnZ\r\nHS/SpPcl4YWVml5zBTbvqwewFusLKK80mBmR0E9ymg9tuK4OL/Z6gVhuTr2Z\r\n168Zx4Kb9Cg92hqmzVjNjPA9xBE3o/dLcJ2swe8hT3tDNYdsM+XN1yPLUHnQ\r\nHljbuQXlykkvJExMa1/K1kJ5WMRg1ug0zmXQfw29KTN71STIqUhEQp0k6r18\r\nMgcCcSgt//J2K6WESO7+hQtHhwUJto60tC74Zrop7xe//vVoolXAuHiNOqse\r\nv+SFqMePEQY9s5mm4L07Rd6XZs3yRVZHzfRpLawIncqEXT9QYBM3a5eM0vv+\r\nfD/3RcSo0VmjaSPTqeOvww+2Hf5R+IDM46pTkKLa0LTuVCOD/TO/mKTjPVL0\r\n+2knPr9DjqoQYNauIguWBKWMEMFy/OShtQ5qq6U5ZlkWFuWYBrGkvL7uqRx8\r\nlAqpvZMpemvLaR2Grs93cYal162kUuh9Zbg=\r\n=HolG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"colel","email":"cole@colelawrence.com"},"directories":{},"maintainers":[{"name":"colel","email":"cole@colelawrence.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/material-color-utilities_0.2.0_1663790565954_0.5286820177098706"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-21T20:02:45.857Z","0.2.0":"2022-09-21T20:02:46.155Z","modified":"2022-09-21T20:02:46.311Z"},"maintainers":[{"name":"colel","email":"cole@colelawrence.com"}],"description":"Algorithms and utilities that power the Material Design 3 (M3) color system, including choosing theme colors from images and creating tones of colors; all in a new color space.","homepage":"https://github.com/colelawrence/material-color-utilities/tree/main/typescript","keywords":["material","material design","material3","material you","color extraction","theming"],"repository":{"type":"git","url":"git+https://github.com/colelawrence/material-color-utilities.git","directory":"typescript"},"author":{"name":"Material Eng"},"bugs":{"url":"https://github.com/colelawrence/material-color-utilities/issues"},"license":"Apache-2.0","readme":"# material-color-utilities\n\n[![npm package](https://badgen.net/npm/v/@material/material-color-utilities)](https://npmjs.com/package/@material/material-color-utilities)\n\nAlgorithms and utilities that power the Material Design 3 (M3) color system,\nincluding choosing theme colors from images and creating tones of colors; all in\na new color space.\n\nSee the main\n[README](https://github.com/material-foundation/material-color-utilities#readme)\nfor more information.\n\n## Getting started\n\n`npm i @material/material-color-utilities` or `yarn add @material/material-color-utilities`\n\n```typescript\nimport { HCT } from \"@material/material-color-utilities\";\n\n// Simple demonstration of HCT.\nconst color = HCT.fromInt(0xff4285f4);\nconsole.log(`Hue: ${color.hue}`);\nconsole.log(`Chrome: ${color.chroma}`);\nconsole.log(`Tone: ${color.tone}`);\n\n```\n\n### Theming\n\n```typescript\nimport { argbFromHex, themeFromSourceColor, applyTheme } from \"@material/material-color-utilities\";\n\n// Get the theme from a hex color\nconst theme = themeFromSourceColor(argbFromHex('#f82506'), [\n  {\n    name: \"custom-1\",\n    value: argbFromHex(\"#ff0000\"),\n    blend: true,\n  },\n]);\n\n// Print out the theme as JSON\nconsole.log(JSON.stringify(theme, null, 2));\n\n// Check if the user has dark mode turned on\nconst systemDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n\n// Apply the theme to the body by updating custom properties for material tokens\napplyTheme(theme, {target: document.body, dark: systemDark});\n\n```\n\n## Troubleshooting\n\nIf using node make sure to use the following flag:\n\n```\nnode --experimental-specifier-resolution=node\n```\n\n\n## Contributing\n\nThis repo is not accepting external contributions, but feature requests and bug\nreports are welcome on\n[GitHub](https://github.com/material-foundation/material-color-utilities/issues).\n","readmeFilename":"README.md"}