{"id":21526863,"url":"https://github.com/nathan-abela/text-contrast-ml","last_synced_at":"2026-05-08T03:43:09.827Z","repository":{"id":193870909,"uuid":"689124379","full_name":"nathan-abela/Text-Contrast-ML","owner":"nathan-abela","description":"A machine learning web application that uses Brain.js neural networks to automatically adjust text color based on the background color when trained enough, developed with Next.js and Shadcn-ui.","archived":false,"fork":false,"pushed_at":"2023-09-24T12:02:31.000Z","size":845,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T05:42:40.454Z","etag":null,"topics":["ai","brainjs","machine-learning","neural-network","nextjs","radix-ui","shadcn-ui","tailwindcss"],"latest_commit_sha":null,"homepage":"https://nathan-abela.github.io/Text-Contrast-ML","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathan-abela.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-08T21:34:20.000Z","updated_at":"2023-12-07T03:08:32.000Z","dependencies_parsed_at":"2023-09-10T14:55:35.089Z","dependency_job_id":null,"html_url":"https://github.com/nathan-abela/Text-Contrast-ML","commit_stats":null,"previous_names":["nathan-abela/text-contrast-ml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-abela%2FText-Contrast-ML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-abela%2FText-Contrast-ML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-abela%2FText-Contrast-ML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-abela%2FText-Contrast-ML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathan-abela","download_url":"https://codeload.github.com/nathan-abela/Text-Contrast-ML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244090752,"owners_count":20396474,"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":["ai","brainjs","machine-learning","neural-network","nextjs","radix-ui","shadcn-ui","tailwindcss"],"created_at":"2024-11-24T01:46:56.679Z","updated_at":"2026-05-08T03:43:09.821Z","avatar_url":"https://github.com/nathan-abela.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://nathan-abela.github.io/Text-Contrast-ML\"\u003e\n        \u003cimg src=\"src/app/icon.svg\" width=\"80\" alt=\"Text Contrast ML Logo\"/\u003e\n    \u003c/a\u003e\n\n# Text Contrast ML\n\nTrain a neural network to predict optimal text color for any background. Runs entirely in your browser.\n\n[![Next.js](https://img.shields.io/badge/Next.js-black?style=flat\u0026logo=next.js)](https://nextjs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-blue?style=flat\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org)\n[![Tailwind CSS](https://img.shields.io/badge/Tailwind-38B2AC?style=flat\u0026logo=tailwindcss\u0026logoColor=white)](https://tailwindcss.com)\n[![Brain.js](https://img.shields.io/badge/Brain.js-FF6B6B?style=flat)](https://brain.js.org)\n\n![Last Commit](https://img.shields.io/github/last-commit/nathan-abela/Text-Contrast-ML)\n![GitHub Stars](https://img.shields.io/github/stars/nathan-abela/Text-Contrast-ML)\n![Views](https://gitviews.com/repo/nathan-abela/Text-Contrast-ML.svg?style=flat)\n\n\u003c/div\u003e\n\n## Live Demo\n\nCheck out the live site at **[nathan-abela.github.io/Text-Contrast-ML](https://nathan-abela.github.io/Text-Contrast-ML)**\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"public/preview-prediction.png\" width=\"700\" alt=\"Text Contrast ML Preview\"/\u003e\n\u003c/p\u003e\n\n## Features\n\n- **Interactive training** - Label background colors with your preferred text color (black or white)\n- **Client-side ML** - Neural network trains directly in your browser using Brain.js\n- **Instant predictions** - Test any color and see the model's recommendation\n- **Save models** - Store up to 5 trained models in browser storage\n- **Training quality indicator** - See how well your model learned based on loss and example count\n- **No backend** - All processing happens locally, no data leaves your device\n\n## How It Works\n\n1. **Train** - You're shown random background colors. Pick whether black or white text is easier to read.\n2. **Learn** - The neural network learns patterns from your choices.\n3. **Predict** - Pick any color and the model predicts the best text color.\n\nFor technical details, visit the [Learn page](https://nathan-abela.github.io/Text-Contrast-ML/learn).\n\n## Getting Started\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/nathan-abela/Text-Contrast-ML.git\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n   \u003e **Note:** The `.npmrc` file skips native compilation for Brain.js. No Python or C++ build tools needed. See [troubleshooting.md](troubleshooting.md) if you encounter issues.\n\n3. **Start the development server:**\n\n   ```bash\n   npm run dev\n   ```\n\n4. **Open your browser:**\n\n   Navigate to [http://localhost:3000](http://localhost:3000)\n\n## Technologies Used\n\n- [Next.js](https://nextjs.org) - React framework with static export\n- [TypeScript](https://www.typescriptlang.org) - Type safety\n- [Tailwind CSS](https://tailwindcss.com) - Utility-first styling\n- [shadcn/ui](https://ui.shadcn.com) - UI components\n- [Brain.js](https://brain.js.org) - Client-side neural networks\n\n---\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"src/app/icon.svg\" width=\"40\" alt=\"Text Contrast ML Icon\"/\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-abela%2Ftext-contrast-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathan-abela%2Ftext-contrast-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-abela%2Ftext-contrast-ml/lists"}