{"id":15674865,"url":"https://github.com/mikaello/rescript-tinycolor","last_synced_at":"2026-02-14T19:31:27.682Z","repository":{"id":40914078,"uuid":"173448425","full_name":"mikaello/rescript-tinycolor","owner":"mikaello","description":"ReScript bindings for TinyColor: fast, small color manipulation and conversion","archived":false,"fork":false,"pushed_at":"2026-01-13T16:44:10.000Z","size":425,"stargazers_count":16,"open_issues_count":7,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-13T18:43:05.272Z","etag":null,"topics":["bucklescript-bindings","javascript-utility","rescript-bindings"],"latest_commit_sha":null,"homepage":"","language":"ReScript","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/mikaello.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-02T13:00:44.000Z","updated_at":"2025-12-16T08:27:49.000Z","dependencies_parsed_at":"2025-08-21T12:04:59.031Z","dependency_job_id":"0f6152fc-b0c2-4c4a-b3bf-566b74864632","html_url":"https://github.com/mikaello/rescript-tinycolor","commit_stats":{"total_commits":91,"total_committers":8,"mean_commits":11.375,"dds":0.3296703296703297,"last_synced_commit":"078fc3462801bb47c1f83d658ae22003c4ef9cc5"},"previous_names":["mikaello/bs-tinycolor"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/mikaello/rescript-tinycolor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaello%2Frescript-tinycolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaello%2Frescript-tinycolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaello%2Frescript-tinycolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaello%2Frescript-tinycolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaello","download_url":"https://codeload.github.com/mikaello/rescript-tinycolor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaello%2Frescript-tinycolor/sbom","scorecard":{"id":644855,"data":{"date":"2025-08-11","repo":{"name":"github.com/mikaello/rescript-tinycolor","commit":"224a95936591b27e6c59b3a647cabac105baea22"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/mikaello/rescript-tinycolor/build-and-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mikaello/rescript-tinycolor/build-and-test.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-and-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T11:52:50.607Z","repository_id":40914078,"created_at":"2025-08-21T11:52:50.607Z","updated_at":"2025-08-21T11:52:50.607Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29453393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bucklescript-bindings","javascript-utility","rescript-bindings"],"created_at":"2024-10-03T15:52:06.107Z","updated_at":"2026-02-14T19:31:27.660Z","avatar_url":"https://github.com/mikaello.png","language":"ReScript","readme":"# rescript-tinycolor\n\n[![NPM version](http://img.shields.io/npm/v/rescript-tinycolor.svg)](https://www.npmjs.org/package/rescript-tinycolor)\n[![Build Status](https://travis-ci.com/mikaello/rescript-tinycolor.svg?branch=master)](https://travis-ci.com/mikaello/rescript-tinycolor)\n\nReScript bindings for [TinyColor](https://github.com/scttcper/tinycolor): fast, small color manipulation and conversion. See also \u003chttps://tinycolor.vercel.app\u003e\n\n## Getting started\n\n```\nyarn add rescript-tinycolor\n```\n\nThen add `rescript-tinycolor` as a dependency to `bsconfig.json`:\n\n```diff\n\"bs-dependencies\": [\n+  \"rescript-tinycolor\"\n]\n```\n\n## Example\n\n```reason\nopen RescriptTinycolor;\n\nlet redString = TinyColor.makeFromString(\"red\");\n/* New instance made by name 'red' */\n\nlet blueRgb = TinyColor.makeFromRgb({r: 0, g: 0, b: 255});\n/* New instance made with RGB values */\n\nlet yellowHsl = TinyColor.makeFromHsl({h: 60, s: 0.94, l: 0.5});\n/* New instance made with HSL values (saturation and lightness must be given as percent fractions) */\n\nlet darkGreenHsv = TinyColor.makeFromHsv({h: 100, s: 1.0, v: 0.3});\n/* New instance made with HSV values (saturation and value must be given as percent fractions) */\n\nlet blueRgbWithAlpha = Belt.Option.map(blueRgb, TinyColor.setAlpha(0.2));\n/* New instance with changed alpha */\n\nlet brightness = Belt.Option.map(redString, TinyColor.getBrightness);\n/* Some(76.245) */\n\nlet hexString = Belt.Option.map(blueRgb, TinyColor.toHexString);\n/* Some(\"#0000ff\") */\n\nlet shadedBlue = Belt.Option.map(blueRgb, TinyColor.shade(~value=50));\n/* New instanced with color shaded 50% */\n\nlet isReadableInCombination = switch(redString, blueRgb) {\n    | (Some(red), Some(blue)) =\u003e TinyColor.isReadable(red, blue);\n    | _ =\u003e false;\n};\n/* returns a bool telling whether these colors can be used for background/text */\n```\n\nSee all available functions in the [original TinyColor repo](https://github.com/scttcper/tinycolor) and example usage of all functions in [the tests](https://github.com/mikaello/rescript-tinycolor/blob/master/__tests__/Tinycolor_tests.re).\n\n## Differences from original\n\n- It is not possible to create an invalid tinycolor instance, it will either return `Some(t)` if it is valid, or `None` if it is invalid. E.g. an invalid instance can occur if you create a color with a string not corresponding to a valid color (`beautifulRed` is not a valid color) or you provide RGB values outside the valid range (0-255).\n- When creating instances with HSL and HSV values: saturation, lightness and value must be given as fractions instead of percent (`0.2 == 20%`).\n- All functions accept only TinyColor-instances created by one of the `make-`-functions (or `random()`), it is not possible to pass in a string or RGB-record for the functions (which is possible in the original library).\n- `setAlpha(val)` is immutable, it will return a new instance with changed alpha value (the other methods that modify a color (`spin`, `lighten`, etc.) is immutable from the original library).\n- `toName()` returns an option, either `Some(string)` if a name could be deduced (e.g. _red_) or `None` if not.\n- To get multiple random colors with the `count` parameter, the function `randomMultiple()` must be used (which is the same as `random()` only that it returns an array with length `count` instead of a single color).\n\n## Contribute\n\nIf you find bugs or there are updates in [TinyColor](https://github.com/bgrins/TinyColor), feel free to open an issue or PR. If you are upgrading any dependencies, please use yarn so `yarn.lock` is updated.\n\nIf you add, remove or change bindings, remember to update the tests as well. It should be at least one test for every binding. Run the tests with `yarn test` from project root.\n\n## Alternatives / related\n\n- [bs-parse-color](https://redex.github.io/package/unpublished/theatlasroom/bs-parse-color/) - bindings for [parse-color](https://github.com/substack/parse-color)\n- [bs-randomcolor](https://github.com/ktrzos/bs-randomColor) - bindings for [randomColor](https://github.com/davidmerfield/randomColor/) (which is the same implementation as `random()` in this library)\n- [re-color-contrast](https://github.com/mikaello/re-color-contrast) - ReasonML implementation of color-contrast calculation (which is the same as `readability(..)` in this library).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaello%2Frescript-tinycolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaello%2Frescript-tinycolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaello%2Frescript-tinycolor/lists"}