{"id":16799998,"url":"https://github.com/dajudge/color-diff","last_synced_at":"2026-03-02T10:02:24.095Z","repository":{"id":57718594,"uuid":"123281347","full_name":"dajudge/color-diff","owner":"dajudge","description":"A library for comparing colors.","archived":false,"fork":false,"pushed_at":"2018-11-13T12:58:46.000Z","size":78,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T06:00:40.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dajudge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-28T12:22:32.000Z","updated_at":"2025-02-04T02:39:01.000Z","dependencies_parsed_at":"2022-09-02T08:51:04.382Z","dependency_job_id":null,"html_url":"https://github.com/dajudge/color-diff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dajudge/color-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajudge%2Fcolor-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajudge%2Fcolor-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajudge%2Fcolor-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajudge%2Fcolor-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dajudge","download_url":"https://codeload.github.com/dajudge/color-diff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dajudge%2Fcolor-diff/sbom","scorecard":{"id":317411,"data":{"date":"2025-08-11","repo":{"name":"github.com/dajudge/color-diff","commit":"1e6f56bc237abc8a08ef3902ec5c4c5aae679214"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Maintained","score":0,"reason":"0 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":"Code-Review","score":0,"reason":"Found 0/8 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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Warn: project license file does not contain an FSF or OSI license."],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: builder/jdk8/Dockerfile:1: pin your Docker image by updating java:openjdk-8u111-jdk-alpine to java:openjdk-8u111-jdk-alpine@sha256:d49bf8c44670834d3dade17f8b84d709e7db47f1887f671a0e098bafa9bae49f","Info:   0 out of   1 containerImage 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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-18T00:32:38.970Z","repository_id":57718594,"created_at":"2025-08-18T00:32:38.971Z","updated_at":"2025-08-18T00:32:38.971Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29998078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T09:59:02.300Z","status":"ssl_error","status_checked_at":"2026-03-02T09:59:02.001Z","response_time":60,"last_error":"SSL_read: 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":[],"created_at":"2024-10-13T09:30:24.937Z","updated_at":"2026-03-02T10:02:24.074Z","avatar_url":"https://github.com/dajudge.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# color-diff\n[![Pipeline status](https://gitlab.com/dajudge/color-diff/badges/master/pipeline.svg)](https://gitlab.com/dajudge/color-diff/commits/master)\n[![Maven Central](https://img.shields.io/maven-central/v/com.dajudge.color-diff/color-diff.svg?maxAge=2592000)](http://search.maven.org/#search%7Cga%7C1%7Cg%3Acom.dajudge.color-diff%20a%3Acolor-diff)\n\n__Disclaimer__: This project aims to be a 1:1 port of Markus Ekholm's great\n[color-diff](https://github.com/markusn/color-diff) library which is\nwritten in Javascript (hence the occasional untypical naming convention).\n\nImplements the CIEDE2000 color difference algorithm, conversion between RGB and\nLAB color and mapping all colors in palette X to the closest color in palette Y\nbased on the CIEDE2000 difference.\n\n## Installation\ncolor-diff is available on maven central. It works on JDK 8 and later. Use the following snipped in \nyour `pom.xml` to add it as a dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.dajudge.color-diff\u003c/groupId\u003e\n    \u003cartifactId\u003ecolor-diff\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\nIf you're using gradle then you'll want something like this:\n```groovy\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n}\n\ndependencies {\n    compile 'com.dajudge.color-diff:color-diff:0.0.4'\n}\n```\ncolor-diff has no transitive dependencies, so you won't face any compatiblity issues.\n \n## Build / Tests\nIf you want to build it yourself just checkout the source and run the following command:\n```\n./gradlew clean build\n```\nTests are implemented in JUnit 5 and run with the build.\n## Usage\n\n### ColorDiff.closest(color, palette, bc)\n\nReturns the closest color. The parameter bc is optional and is used as\nbackground color when the color and/or palette uses alpha channels.\n\n```java\nRgbColor color = new RgbColor(255, 1, 30);\n\nList\u003cRgbColor\u003e palette = Arrays.asList(\n        new RgbColor(255, 0, 0), // red\n        new RgbColor(0, 255, 0), // green\n        new RgbColor(0, 0, 255)  // blue\n);\n\nRgbColor closestMatch = ColorDiff.closest(color, palette);\nassertEquals(new RgbColor(255, 0, 0), closestMatch); // red\n```\n\nThe result above is obvious, but `ColorDiff.closest()` could deal with more complicated\ncases.\n\n### ColorDiff.furthest(color, palette, bc)\n\nReturns the most different color. The parameter bc is optional and is used as\nbackground color when the color and/or palette uses alpha channels.\n\n```java\nRgbColor color = new RgbColor(255, 255, 255); // white\n\nList\u003cRgbColor\u003e palette = Arrays.asList(\n        new RgbColor(0, 0, 0),      // black\n        new RgbColor(255, 255, 255) // white\n);\n\nRgbColor furthestMatch = ColorDiff.furthest(color, palette);\nassertEquals(new RgbColor(0,0,0), furthestMatch); // black\n```\n\nThe result above is obvious, but `ColorDiff.furthest()` could deal with more\ncomplicated cases.\n\n\n### ColorDiff.map_palette(palette1, palette2)\n\nReturns a mapping from the colors in `palette1` to `palette2`.\n\n\n#### RgbColor\n`RgbColor` is type containing 3 properties: `R`, `G`, `B`, such as:\n\n```java\nRgbColor color = new RgbColor(255, 1, 0);\n```\n\nThere is an optional (i.e. nullable) property `A`, which specifies\nthe alpha channel between 0.0 and 1.0.\n\n```java\nRgbColor colorWithAlpha = new RgbColor(255, 1, 0, .5);\n```\n\nEach RGBA-color is transformed into a RGB-color before being used to calculate\nthe CIEDE2000 difference, using the specified background color (which defaults to white).\n\n## Authors\nOriginal Javascript version by Markus Ekholm\n\nJava port by Alex Stockinger\n\n## License\n3-clause BSD. For details see `COPYING`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdajudge%2Fcolor-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdajudge%2Fcolor-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdajudge%2Fcolor-diff/lists"}