{"id":16349341,"url":"https://github.com/stevemao/color-transitions","last_synced_at":"2025-10-16T21:47:10.136Z","repository":{"id":57203225,"uuid":"67930396","full_name":"stevemao/color-transitions","owner":"stevemao","description":null,"archived":false,"fork":false,"pushed_at":"2016-10-19T11:24:54.000Z","size":19,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T04:50:51.054Z","etag":null,"topics":[],"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/stevemao.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":"2016-09-11T13:09:04.000Z","updated_at":"2022-02-02T17:49:05.000Z","dependencies_parsed_at":"2022-09-17T00:51:30.428Z","dependency_job_id":null,"html_url":"https://github.com/stevemao/color-transitions","commit_stats":null,"previous_names":["stevemao/color-animations"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevemao%2Fcolor-transitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevemao%2Fcolor-transitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevemao%2Fcolor-transitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevemao%2Fcolor-transitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevemao","download_url":"https://codeload.github.com/stevemao/color-transitions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234135271,"owners_count":18784944,"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-11T00:59:10.641Z","updated_at":"2025-09-24T22:31:33.209Z","avatar_url":"https://github.com/stevemao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-transitions [![Build Status](https://travis-ci.org/stevemao/color-transitions.svg?branch=master)](https://travis-ci.org/stevemao/color-transitions) [![Coverage Status](https://coveralls.io/repos/github/stevemao/color-transitions/badge.svg?branch=master)](https://coveralls.io/github/stevemao/color-transitions?branch=master)\n\n\u003e Smooth color transitions\n\n\n**Experimental module**\n\n[Visual demo](http://www.webpackbin.com/41GwsiZa-)\n\n## Install\n\n```\n$ npm install --save color-transitions\n```\n\n\n## Usage\n\n```js\nconst colorTransitions = require('color-transitions');\n\ncolorTransitions('blue', 'red', color =\u003e {\n\t// `color` will be the color value between 'blue' and 'red'\n});\n```\n\n\n## API\n\n### colorTransitions(color1, color2, [options], cb)\n\n#### color1, color2\n\nSame as the [color setter](https://github.com/Qix-/color#setters).\n\n#### options\n\n##### duration\n\nType: `number`\u003cbr\u003e\nDefault: `1000`\n\nThe transition duration option specifies the number of seconds or milliseconds a transition animation should take to complete.\n\n##### timing\n\nType: `string` or `function`\u003cbr\u003e\nDefault: `'linear'`\n\nThe transition timing function option is used to describe how the intermediate values of the color being affected by a transition effect are calculated. This in essence lets you establish an acceleration curve, so that the speed of the transition can vary over its duration.\n\nIf this is string, the function would be from [eases](https://github.com/mattdesl/eases).\n\n##### threshold\n\nType: `number`\u003cbr\u003e\nDefault: `60`\n\nMaximum number of callbacks that can occur in one second.\n\n##### iterations\n\nType: `number` or `boolean`\u003cbr\u003e\nDefault: `1`\n\nHow many transitions between two colors. Specify `true` to make it infinite.\n\n#### cb\n\nType: `function`\n\nCallback function. If return `false`, stop immediately.\n\n##### cb(color, delta, iteration)\n\n###### color\n\nType: `array`\n\nRGB array\n\n###### delta\n\nType: `number`\n\nHow much time has passed since last callback in milliseconds.\n\n###### iteration\n\nType: `number`\n\nWhich iteration. Counting from 1.\n\n###### done\n\nType: `boolean`\n\nIs the transition done?\n\n\n## License\n\nMIT © [Steve Mao](https://github.com/stevemao)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevemao%2Fcolor-transitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevemao%2Fcolor-transitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevemao%2Fcolor-transitions/lists"}