{"id":22888089,"url":"https://github.com/myndex/max-contrast","last_synced_at":"2025-05-07T11:44:28.175Z","repository":{"id":191401450,"uuid":"684562204","full_name":"Myndex/max-contrast","owner":"Myndex","description":"Send it the background color, returns black or white whichever is maximum Lc value","archived":false,"fork":false,"pushed_at":"2023-09-01T16:12:39.000Z","size":7238,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T09:41:15.875Z","etag":null,"topics":["apca","color","contrast","contrast-enhancement","contrast-ratio","css","wcag","web-colors"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Myndex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-29T11:50:16.000Z","updated_at":"2025-03-25T23:50:53.000Z","dependencies_parsed_at":"2023-08-29T18:57:38.051Z","dependency_job_id":"70edf290-a716-4ded-96d9-18f0e50cbe93","html_url":"https://github.com/Myndex/max-contrast","commit_stats":null,"previous_names":["myndex/max-contrast"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Myndex%2Fmax-contrast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Myndex%2Fmax-contrast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Myndex%2Fmax-contrast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Myndex%2Fmax-contrast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Myndex","download_url":"https://codeload.github.com/Myndex/max-contrast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873921,"owners_count":21817708,"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":["apca","color","contrast","contrast-enhancement","contrast-ratio","css","wcag","web-colors"],"created_at":"2024-12-13T20:46:57.199Z","updated_at":"2025-05-07T11:44:28.154Z","avatar_url":"https://github.com/Myndex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\" class=\"por\" style=\"margin: -36px 0 12px\"\u003e\n\u003cb\u003e\u003c/b\u003emaxContrast() Badges\u003c/b\u003e \u003cbr\u003e\n\u003ca href=\"https://github.com/Myndex/max-contrast/blob/main/LICENSE.md\"\u003e\u003cimg src=\"https://badgen.net/badge/license/AGPL 3?icon=github\u0026color=BB5FD1\" alt=\"license\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/Myndex/max-contrast\"\u003e\u003cimg src=\"https://badgen.net/github/last-commit/Myndex/max-contrast/?icon=github\" alt=\"last commit\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/Myndex/max-contrast/src/\"\u003e\u003cimg src=\"https://badgen.net/badge/JS/Vanilla/889900\" alt=\"plain vanilla JS\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://twitter.com/MyndexResearch\"\u003e\u003cimg src=\"https://badgen.net/badge/@/MyndexResearch?icon=twitter\" alt=\"twitter\" /\u003e\u003c/a\u003e\u0026nbsp;\n\n\u003cb\u003eAPCA Project Badges\u003c/b\u003e \u003cbr\u003e\n\u003ca href=\"https://www.myndex.com/CVD/\"\u003e\u003cimg src=\"https://badgen.net/badge/Color Vision/Simulator/cc0044\" alt=\"CVD Simulator\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://git.myndex.com\"\u003e\u003cimg src=\"https://badgen.net/badge/APCA/Resources/3300aa\" alt=\"APCA Resources\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://github.com/Myndex/SAPC-APCA\"\u003e\u003cimg src=\"https://badgen.net/badge/SAPC-APCA/Main Repo/db6b0b\" alt=\"SAPC/Main Repo\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003ca href=\"https://www.myndex.com/APCA/\"\u003e\u003cimg src=\"https://badgen.net/badge/APCA/Live Tool/db6b0b\" alt=\"APCA/Live Tool/\" /\u003e\u003c/a\u003e\u0026nbsp;\n\u003c/p\u003e\n\n# maxContrast()\nSend it the \u003cb\u003ebackground\u003c/b\u003e color, it returns a black or white \u003cb\u003etext\u003c/b\u003e color, whichever is maximum APCA Lc value\n\n```JS\n        // Version in maxContrastArray.js\n    let color = maxContrast([0xce,0x96,0x99])\nconsole.log(color); // [0,0,0]\n\n```\n```JS\n\n        // Version in maxContrastString.js\n    let color = maxContrast(119,127,206) \nconsole.log(color); // 'white'\n\n```\n\nThis is part of the [APCA contrast project](https://github.com/Myndex/SAPC-APCA).\n\n## Files\n- `/src/maxContrastArray.js` send an RGB array, it returns an RGB array, suitable for use with [ColorParsley](https://github.com/Myndex/colorparsley)\n\n- `/src/maxContrastString.js` send R G and B ints, it returns a color string.\n\n### Related Resources\n- [Fancy Font Flipping](https://github.com/Myndex/fancyfontflipping) experimental demonstrator showing the ideas behind this.\n- [APCA Linktree](https://linktr.ee/Myndex) Curated quick-start documentation for APCA \n- [APCA Documentation Repo](https://github.com/Myndex/SAPC-APCA) Main APCA docs\n- [APCA Readability Criterion](https://readtech.org/ARC/) public working draft\n- [apca-w3](https://github.com/Myndex/apca-w3) public APCA for W3 and WCAG 3\n- [ColorParsley](https://github.com/Myndex/colorparsley) lightweight micro-library for parsing colors\n\n\nLicense is modified GNU 3.\n\n\n\u003cimg alt=\" an image of mad max racing through the desert and behind them are the letters MAX and under that is the word contrast\" src=\"img/generaltitles_MAX_CONTRAST_2.png\"\u003e\nCopyright © 2023 by Andrew Somers. All Rights Reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyndex%2Fmax-contrast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyndex%2Fmax-contrast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyndex%2Fmax-contrast/lists"}