{"id":21520081,"url":"https://github.com/mrnkr/color-utils","last_synced_at":"2025-04-09T22:11:39.749Z","repository":{"id":34076726,"uuid":"127696834","full_name":"mrnkr/color-utils","owner":"mrnkr","description":"Simple functions to work with colors written in Vanila Javascript","archived":false,"fork":false,"pushed_at":"2023-01-06T13:27:39.000Z","size":1190,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:01:40.105Z","etag":null,"topics":["colors","javascript","vanilla-javascript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dead-simple-color-utils","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/mrnkr.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":"2018-04-02T03:15:40.000Z","updated_at":"2022-12-27T02:35:24.000Z","dependencies_parsed_at":"2023-01-15T04:27:36.601Z","dependency_job_id":null,"html_url":"https://github.com/mrnkr/color-utils","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/mrnkr%2Fcolor-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnkr%2Fcolor-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnkr%2Fcolor-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrnkr%2Fcolor-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrnkr","download_url":"https://codeload.github.com/mrnkr/color-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247909139,"owners_count":21016478,"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":["colors","javascript","vanilla-javascript"],"created_at":"2024-11-24T01:01:08.484Z","updated_at":"2025-04-09T22:11:39.712Z","avatar_url":"https://github.com/mrnkr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Color Utilities\n\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Build Status](https://travis-ci.com/mrnkr/color-utils.svg?branch=master)](https://travis-ci.com/mrnkr/color-utils)\n[![codecov](https://codecov.io/gh/mrnkr/color-utils/branch/master/graph/badge.svg)](https://codecov.io/gh/mrnkr/color-utils)\n[![License][license]][npm-url]\n\n[npm-image]:http://img.shields.io/npm/v/dead-simple-color-utils.svg\n[npm-url]:https://npmjs.org/package/dead-simple-color-utils\n[downloads-image]:http://img.shields.io/npm/dm/dead-simple-color-utils.svg\n[license]:https://img.shields.io/github/license/mrnkr/color-utils\n\nBasic functions to work with colors in javascript\n\n## Intro\n\nThe purpose of this library is to have a compilation of the functions I use to process my colors. It is extremely limited since it contains, as I said, only functions I've needed accross my projects.\n\nSome possible use cases are calculating the best text color according to the background color (chooses between only black and white but could easily be modified to achieve a comparison with several colors if it were necessary) and lightening or darkening a color on demand.\n\nWhy would you want these functions? Well, say you had a color picker and wanted to put a marker on top of the selected color... There you have your use for the calculate ideal text color function. Now imagine you wanted to have a different color for your status bar than the one in your app bar (like in Android). You could achieve that easily by processing one of the colors lightening or darkening it.\n\n## Quick Start\n\n```javascript\nimport { shadeBlendConvert, calculateBestTextColor } from \"color-utils\";\n\n// Darkens a color by 10%\nshadeBlendConvert(\"#83fc8f\", -10);\n\n// Lightens a color by 19%\nshadeBlendConvert(\"#fc83d3\", 19);\n\n// Calculates the best text color for the passed background\ncalculateBestTextColor(\"#f62459\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrnkr%2Fcolor-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrnkr%2Fcolor-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrnkr%2Fcolor-utils/lists"}