{"id":19723893,"url":"https://github.com/wraith13/phi-colors","last_synced_at":"2026-06-05T21:31:59.696Z","repository":{"id":34220994,"uuid":"170429795","full_name":"wraith13/phi-colors","owner":"wraith13","description":"phi-colors is a library that generates phi ratio colors for JavaScript/TypeScript.","archived":false,"fork":false,"pushed_at":"2022-04-10T02:08:07.000Z","size":45,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T13:43:08.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wraith13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-13T02:57:12.000Z","updated_at":"2020-03-30T12:20:50.000Z","dependencies_parsed_at":"2022-07-24T18:02:30.113Z","dependency_job_id":null,"html_url":"https://github.com/wraith13/phi-colors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fphi-colors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fphi-colors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fphi-colors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fphi-colors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wraith13","download_url":"https://codeload.github.com/wraith13/phi-colors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241045513,"owners_count":19899664,"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-11-11T23:23:50.255Z","updated_at":"2025-02-27T18:45:08.601Z","avatar_url":"https://github.com/wraith13.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phi-colors\n\nphi-colors is a library that generates phi ratio colors that like [this](https://wraith13.github.io/phi-ratio-coloring/phi-ratio-coloring.htm) for JavaScript/TypeScript.\n\n## How to use\n\n```javascript\nconst phiColors = require('phi-colors').phiColors;\n\nconsole.log(phiColors.phi); // 1.618033988749895\nconst rgba = phiColors.rgbaFromStyle(\"#FFCC8844\"); // {\"r\":1,\"g\":0.8,\"b\":0.5333333333333333,\"a\":0.26666666666666666}\nconst hsla = phiColors.rgbaToHsla(rgba); // {\"h\":0.6058911188392467,\"s\":0.27034500134658757,\"l\":0.7777777777777778,\"a\":0.26666666666666666}\nconst newColors = [];\nfor(let i = 0; i \u003c 7; ++i)\n{\n    const generatedHsla = phiColors.generate\n    (\n        hsla,   // base color\n        i,      // hue arrange index\n        0.0,    // saturation arrange index\n        0.0,    // lightness arrange index\n        0.0     // alpha arrange index\n    );\n    const generatedRgba = phiColors.hslaToRgba(generatedHsla);\n    const generatedStyle = phiColors.rgbaForStyle(generatedRgba);\n    newColors.push(generatedStyle);\n}\nconsole.log(JSON.stringify(newColors)); // [\"#FFCC8844\",\"#EAE1FF44\",\"#97FE9644\",\"#FFC7D944\",\"#B5E0FF44\",\"#D6E57644\",\n```\n\n## How to build\n\nrequires: [Node.js](https://nodejs.org/), [TypeScript Compiler](https://www.npmjs.com/package/typescript)\n\n`tsc -P .` or `tsc -P . -w`\n\n### In VS Code\n\nYou can use automatic build. Run `Tasks: Allow Automatic Tasks in Folder` command from command palette ( Mac: \u003ckbd\u003eF1\u003c/kbd\u003e or \u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eCommand\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e, Windows and Linux: \u003ckbd\u003eF1\u003c/kbd\u003e or \u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e), and restart VS Code.\n\n## License\n\n[Boost Software License](./LICENSE_1_0.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwraith13%2Fphi-colors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwraith13%2Fphi-colors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwraith13%2Fphi-colors/lists"}