{"id":18043928,"url":"https://github.com/patelka2211/dynamic-colors","last_synced_at":"2025-04-09T22:34:25.488Z","repository":{"id":175502813,"uuid":"653971957","full_name":"patelka2211/dynamic-colors","owner":"patelka2211","description":"Dynamic Colors is a JavaScript library that can dynamically generate color theme from a single HEX color and it provides a range of useful APIs for creating, managing, and manipulating color themes.","archived":false,"fork":false,"pushed_at":"2024-01-14T08:05:05.000Z","size":213,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-14T20:04:59.404Z","etag":null,"topics":["kpverse","material-dynamic-colors","material-theme","npm-package","patelka2211","typescript"],"latest_commit_sha":null,"homepage":"https://kpverse.in/dynamic-colors/","language":"TypeScript","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/patelka2211.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T06:12:34.000Z","updated_at":"2023-08-02T07:02:07.000Z","dependencies_parsed_at":"2024-01-14T09:24:35.205Z","dependency_job_id":"bc8a273f-4643-40b5-9383-fdac28e5e901","html_url":"https://github.com/patelka2211/dynamic-colors","commit_stats":null,"previous_names":["patelka2211/dynamic-colors"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelka2211%2Fdynamic-colors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelka2211%2Fdynamic-colors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelka2211%2Fdynamic-colors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patelka2211%2Fdynamic-colors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patelka2211","download_url":"https://codeload.github.com/patelka2211/dynamic-colors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276098,"owners_count":20912287,"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":["kpverse","material-dynamic-colors","material-theme","npm-package","patelka2211","typescript"],"created_at":"2024-10-30T17:10:27.669Z","updated_at":"2025-04-09T22:34:25.466Z","avatar_url":"https://github.com/patelka2211.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://repository-images.githubusercontent.com/653971957/a63f11cb-aa1e-41f2-8418-e4e7580f3c31)](https://npmjs.com/package/dynamic-colors \"Dynamic Colors from KPVERSE\")\n\n# Dynamic Colors\n\n**Dynamic Colors** is a JavaScript library that can dynamically generate color palette from a single HEX color and it provides a range of useful APIs for creating, managing, and manipulating color palettes such as [_create()_](#create), [_remove()_](#remove), [_setAutoTheme()_](#setautotheme), [_setDarkTheme()_](#setdarktheme), [_setLightTheme()_](#setlighttheme), [_themeCycle()_](#themecycle), [_isInstance()_](#isinstance).\n\n## Installation\n\n[![npm (scoped)](https://img.shields.io/npm/v/dynamic-colors)](https://www.npmjs.com/package/dynamic-colors)\n[![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/dynamic-colors)](https://bundlephobia.com/package/dynamic-colors@1.1.5)\n[![npm](https://img.shields.io/npm/dy/dynamic-colors)](https://www.npmjs.com/package/dynamic-colors)\n[![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/gh/hy/patelka2211/dynamic-colors)](https://cdn.jsdelivr.net/gh/patelka2211/dynamic-colors@1.1.5/)\n\nTo install Dynamic Colors using npm, run the following command:\n\n```sh\nnpm i dynamic-colors\n```\n\nAlternatively, you can include [Dynnamic Colors's IIFE file](https://cdn.jsdelivr.net/gh/patelka2211/dynamic-colors@1.1.5/DynamicColors.js) in your website using a `\u003cscript\u003e` tag:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/patelka2211/dynamic-colors@1.1.5/DynamicColors.js\"\u003e\u003c/script\u003e\n```\n\n## Available APIs\n\n### create()\n\nThe [create()](#create) function creates a new instance of the [DynamicColors class](#dynamiccolors-class), which is used to manage color palettes.\n\n|         | Available as           |\n| :------ | :--------------------- |\n| in ESM  | create()               |\n| in IIFE | DynamicColors.create() |\n\n### remove()\n\nThe [remove()](#remove) function is used to unsubscribe an instance of the [DynamicColors class](#dynamiccolors-class) from all available DynamicColors instances. By calling this function with the desired instance as an argument, you can effectively remove the instance's association with the color palettes managed by Dynamic Colors.\n\n|         | Available as           |\n| :------ | :--------------------- |\n| in ESM  | remove()               |\n| in IIFE | DynamicColors.remove() |\n\n### setAutoTheme()\n\nThe [setAutoTheme()](#setautotheme) function subscribes all instances of the [DynamicColors class](#dynamiccolors-class) to automatically change the theme based on the user's operating system theme.\n\n|         | Available as                 |\n| :------ | :--------------------------- |\n| in ESM  | setAutoTheme()               |\n| in IIFE | DynamicColors.setAutoTheme() |\n\n### setDarkTheme()\n\nThe [setDarkTheme()](#setdarktheme) function changes all instances of the [DynamicColors class](#dynamiccolors-class) to a dark theme.\n\n|         | Available as                 |\n| :------ | :--------------------------- |\n| in ESM  | setDarkTheme()               |\n| in IIFE | DynamicColors.setDarkTheme() |\n\n### setLightTheme()\n\nThe [setLightTheme()](#setlighttheme) function changes all instances of the [DynamicColors class](#dynamiccolors-class) to a light theme.\n\n|         | Available as                  |\n| :------ | :---------------------------- |\n| in ESM  | setLightTheme()               |\n| in IIFE | DynamicColors.setLightTheme() |\n\n### themeCycle()\n\nThe [themeCycle()](#themecycle) function cycles through different themes based on the current theme:\n\n|         | Available as               |\n| :------ | :------------------------- |\n| in ESM  | themeCycle()               |\n| in IIFE | DynamicColors.themeCycle() |\n\n-   If the current theme is `Auto`, the next theme will be `Light`.\n-   If the current theme is `Light`, the next theme will be `Dark`.\n-   If the current theme is `Dark`, the next theme will be `Auto`.\n\n### isInstance()\n\nDetermines whether the given object is an instance of [`DynamicColors`](#dynamiccolors-class). Returns `true` if the object is an instance of [`DynamicColors`](#dynamiccolors-class), otherwise `false`.\n\n## Internally used functionalities\n\n### DynamicColors class\n\nThe [DynamicColors class](#dynamiccolors-class) is used internally by Dynamic Colors to manage the color palettes it generates. It has the following characteristics:\n\nThe [DynamicColors class](#dynamiccolors-class) is created using the [create()](#create) function and can only be removed using the [remove()](#remove) function.\n\n### Material Dynamic Colors\n\nDynamic Colors leverages the power of [Material Dynamic Colors](https://github.com/leonardorafael/material-dynamic-colors) internally to generate color palettes. It builds upon the functionality provided by [Material Dynamic Colors](https://github.com/leonardorafael/material-dynamic-colors) and offers additional features. With Dynamic Colors, you can go beyond the basic color generation and enjoy advanced functionalities tailored to your specific needs, enabling you to create dynamic visual experiences for your web applications.\n\n## License\n\n[![NPM](https://img.shields.io/npm/l/react)](./LICENSE)\n\nThis project is licensed under the [MIT License](./LICENSE), which permits you to use, copy, modify, merge, publish, distribute, and sublicense the software, subject to the conditions stated in the [LICENSE file](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatelka2211%2Fdynamic-colors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatelka2211%2Fdynamic-colors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatelka2211%2Fdynamic-colors/lists"}