Giter Club home page Giter Club logo

asqatasun / contrast-finder Goto Github PK

View Code? Open in Web Editor NEW
54.0 11.0 18.0 13.71 MB

Contrast-Finder finds correct color contrasts (background / foreground) for web accessibility (a11y, WCAG, RGAA). https://app.contrast-finder.org

License: GNU Affero General Public License v3.0

Java 74.32% CSS 2.83% JavaScript 7.17% Shell 5.34% HTML 0.77% Dockerfile 9.57%
contrast contrast-finder wcag color a11y accessibility colour color-blindness rgaa contrast-ratio

contrast-finder's Introduction

License : AGPL v3 Code of Conduct PRs Welcome Release Codacy Badge Travis CI Github Java CI with Maven

Contrast-Finder

Contrast-Finder logo

Demo

https://app.contrast-finder.org

Try Contrast-Finder

Why another contrast tool ?

Just to provide contrast solutions !

There are lot of tools to find a good contrast on the web, but no one to suggest valid contrasts.

All tools just tell you whether the contrast is good or not, which is fine... but insufficient. Webdesigners / webdevelopers need to easily have a good contrast. That's the purpose of Contrast-Finder.org

Contrast-Finder is a tool which computes the contrast between two colors (background, foreground) and checks if the contrast is valid. When the contrast is not valid, the main target is to suggest some correct colors contrasts.

Contact and discussions

We want you! (aka Contribute)

We would be really glad to have you on board! You can help in many ways:

Everything is summarized in the CONTRIBUTING file.

Documentation

  • How to use ?
  • How to install ?
  • How to build ?

Go to the documentation !

Download

License

AGPL v3

contrast-finder's People

Contributors

arnauddelafosse avatar davidjr82 avatar dzc34 avatar jasonkiss avatar jeangauthier avatar kaths31 avatar lingua avatar mfaure avatar miname avatar osake avatar quenty31 avatar rui20 avatar zwiastunsw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contrast-finder's Issues

Remove commons-httpclient dependency

Vulnerability

in Apache Commons HttpClient before 4.2.3
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-6153

Same job than HttpComponents HttpClient

"The Commons HttpClient project is now end of life, and is no longer being developed. It has been replaced by the Apache HttpComponents project in its HttpClient and HttpCore modules, which offer better performance and more flexibility. " http://hc.apache.org/httpclient-3.x/

"The Commons HttpClient project used to be a part of Commons, but is now part of Apache HttpComponents" http://commons.apache.org/

contrast-finder.conf should not be required

Observed behaviour

if /etc/contrast-finder/contrast-finder.conf
file is missing, the webapp fails to start.

By default, Spring will throw an exception if it could not find a properties file or could not resolve a placeholder. That cause the application fails to start.

Solution

Ignoring exceptions

source: http://www.codejava.net/frameworks/spring/reading-properties-files-in-spring-with-propertyplaceholderconfigurer-bean#IgnoringExceptions

  <property name="location" value="file:///etc/contrast-finder/contrast-finder.conf"/>
+ <property name="ignoreResourceNotFound"         value="true" />
+ <property name="ignoreUnresolvablePlaceholders" value="true" />

Empty default value

source: http://blog.codeleak.pl/2015/09/placeholders-support-in-value.html

@Value("${my.string.property:}")
private String stringProperty;

maven WARNING - pom.xml : 'version' contains an expression but should be a constant

Observed behaviour


[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-api:jar:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-api:${project.parent.version}, contrast-finder-api/pom.xml, line 10, column 14
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-utils:jar:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-utils:${project.parent.version}, contrast-finder-utils/pom.xml, line 10, column 14
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-hsv:jar:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-hsv:${project.parent.version}, contrast-finder-hsv/pom.xml, line 10, column 14
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-impl:jar:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-impl:${project.parent.version}, contrast-finder-impl/pom.xml, line 10, column 14
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-webapp:war:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-webapp:${project.parent.version}, contrast-finder-webapp/pom.xml, line 10, column 14
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.asqatasun:contrast-finder-resources:jar:0.4.7-dev
[WARNING] 'version' contains an expression but should be a constant. @ org.asqatasun:contrast-finder-resources:${project.parent.version}, contrast-finder-resources/pom.xml, line 12, column 14
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

Expected behaviour

no [WARNING]

Steps to reproduce the behaviour

mvn clean install

Your configuration

mvn -v                                            
   Apache Maven 3.3.9
   Maven home: /usr/share/maven
   Java version: 1.8.0_121, vendor: Oracle Corporation
   Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre

HTML error

Observed behaviour

https://validator.w3.org/nu/?doc=https%3A%2F%2Fapp.contrast-finder.org%2F&checkerrorpages=yes&showsource=yes&showoutline=yes

selection_020

input tag type=color : different implementations

in the last release

#2 - Used input tag type=color instead off type=text

  <input name="bg" type="color">

different implementations

Firefox xx + Windows xx

Firefox 50 / Ubuntu 16.04

image

Chromium 55 / Ubuntu 16.04

selection_011

resources

Allow to choose sorting column via a parameter in URL

"A nice have would be having results sorted by Distance column or Ratio, etc without any manual action from the user, especially when a link is sent via email or bookmarked for future use.

Adding a parameter in the URL and managing it when page is loaded is a potential solution (at least if the table sorting script has options for that)"
by @PhilippeVay

DOC "Howto build & install" - Missing libspring-instrument-java

added HTTP security headers

added the following HTTP security headers:
	X-Content-Type-Options: nosniff
	X-Frame-Options: DENY
	X-XSS-Protection: 1; mode=block

README update RGAA link

This helps you in satisfying web accessibility (a11y) tests on contrasts:
RGAA test 2.5 (in french)

Deal with multiple backgrounds constraint

  • @thomassola: "I have one suggestion for an enhancement. Your app helps solve the problem of contrast between two colors but often times one foreground color has to work across multiple background colors. If you could add that ability it would be mind blowing. (I don't know Java or I'd try it myself)."
    • @mfaure: "Thanks for your feedback Thomas. That's an excellent idea ! We have to make it.
      By now I don't know how to organise the UI to keep it simple with multiple backgrounds (or either multiple foregrounds). We'll have to do some sketching. Thanks again for your contribution !"

Changed JSTL artifact (jstl:jstl -> org.apache.taglibs:taglibs-standard-jstlel)

Vulnerability

Apache Standard Taglibs before 1.2.3 has a CVSS 7.5 vulnerability
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-0254

selection_004

see all version of jstl (latest version: 12-May-2006)
http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22jstl%22%20AND%20a%3A%22jstl%22

Solution

Changed JSTL artifact (jstl:jstl -> org.apache.taglibs:taglibs-standard-jstlel)
https://tomcat.apache.org/taglibs/standard/

         <dependency>
-            <groupId>jstl</groupId>
-            <artifactId>jstl</artifactId>
-            <version>1.2</version>
+            <groupId>org.apache.taglibs</groupId>
+            <artifactId>taglibs-standard-jstlel</artifactId>
+            <version>1.2.5</version>
         </dependency>

ex:

webapp - lang-switcher: error on the lang attribute

Configuration

Contrast-Finder v0.4.4

Observed behaviour

?lang=en

<div id="lang-switcher"> 
        <strong lang="en">english</strong> 
        <a lang="fr" href="?lang=fr" title="Passer en français" >français</a>
 </div>

?lang=fr

<div id="lang-switcher"> 
        <a href="?lang=en" title="Switch to english">english</a>
        <strong lang="en">français</strong>
 </div>

Expected behaviour

?lang=en

<div id="lang-switcher"> 
        <strong>english</strong> 
        <a lang="fr" href="?lang=fr" title="Passer en français" >français</a>
 </div>

?lang=fr

<div id="lang-switcher"> 
        <a lang="en" href="?lang=en" title="Switch to english">english</a>
        <strong>français</strong>
 </div>

Paths to image files should be relative

Observed behaviour

like #7 for /Images/good.jpg

When installed into a directory (says cf and not contrast-finder), and configured behind an Apache+mod_proxy_html configured with ProxyPass, the CSS of Contrast-Finder app are not loaded.

The paths of CSS files are absolutes (beginning with a slash), thus can't be correctly translated by the ProxyPass directive

Steps to reproduce the behaviour

https://app.contrast-finder.org/result.html?foreground=%23396F3A&background=%23DFF0D8&isBackgroundTested=false&ratio=4.5&algo=HSV

Your configuration

Contrast-Finder 0.4.3 ( 2017-01-24)

prerequisites for maven: version 3.1

Observed behaviour

maven 3.1 is required
for the following plugin
org.owasp:dependency-check-maven

Expected behaviour

    <prerequisites>
        <maven>3.1</maven>
    </prerequisites>

Steps to reproduce the behaviour

mvn versions:display-dependency-updates

outdated dependencies

    - commons-collections4 4.1
      instead of  commons-collections 3.2.2
    
    - commons-cli             1.4     instead of 1.2
    - commons-lang3           3.5     instead of 3.1
    - commons-logging         1.2     instead of 1.1.3
    - logback-classic         1.2.3   instead of 1.2.1
    - maven-dependency-plugin 3.0.0   instead of 2.1
    - maven-war-plugin        3.0.0   instead of 2.1.1
    - javaee-endorsed-api     7.0     instead of 6.0
    - javaee-web-api          7.0     instead of 6.0
    - junit                   4.12    instead of 3.8.2
    - cobertura-maven-plugin  2.7     instead of 2.5.1
    - httpclient              4.5.3   instead of 4.3.6
    - json                   20160810 instead of 20131018

Upgrade SpringFrameworkt to v3.2.12 and remove spring-asm

Vulnerability

The SourceHttpMessageConverter in Spring MVC in Spring Framework before 3.2.5
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-6429

The Spring MVC in Spring Framework before 3.2.4
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-7315

The Spring OXM wrapper in Spring Framework before 3.2.4
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4152

The Jaxb2RootElementHttpMessageConverter in Spring MVC in Spring Framework before 3.2.8
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0054

Cross-site scripting (XSS) vulnerability in web/servlet/tags/form/FormTag.java in Spring MVC in Spring Framework 3.0.0 before 3.2.8
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-1904

Directory traversal vulnerability in Spring Framework 3.x before 3.2.9
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3578

Directory traversal vulnerability in Spring Framework 3.0.4 through 3.2.x before 3.2.12
https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3625

Solution

         <dependency>
             <groupId>org.springframework</groupId>
             (...)
-            <version>3.1.2.RELEASE</version>
+            <version>3.2.12.RELEASE</version>
         </dependency>

-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-asm</artifactId>
-            <version>3.1.2.RELEASE</version>
-        </dependency>

no need to add this spring-asm dependency

from release notes for 3.2 :
"we've eliminated the dedicated spring-asm jar in M2 in favor of including org.springframework.asm classes directly in spring-core"

"In Spring Framework 3.2, spring-asm is upgraded to org.objectweb.asm 4.0 and included in spring-core. Now there is no need to add this spring-asm dependency." source

Paths to CSS files should be relative

Observed behaviour

When installed into a directory (says cf and not contrast-finder), and configured behind an Apache+mod_proxy_html configured with ProxyPass, the CSS of Contrast-Finder app are not loaded.

The paths of CSS files are absolutes (beginning with a slash), thus can't be correctly translated by the ProxyPass directive

Expected behaviour

Have the CSS loaded :)

Your configuration

Contrast-Finder 0.3.4 (december 2016)

Javadoc warnings, @return tag has no arguments, ...

Steps to reproduce the behaviour

mvn javadoc:aggregate | grep WARNING

Observed behaviour

  • [WARNING] Javadoc Warnings :
    • @return tag has no arguments
    • @return tag cannot be used in method with void return type.
    • @param argument * is not a parameter name
[WARNING] Javadoc Warnings
[WARNING] *-utils/src/main/java/*/contrastchecker/ContrastChecker.java:76: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/contrastchecker/ContrastChecker.java:123: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/colorconvertor/ColorConverter.java:57: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/colorconvertor/ColorConverter.java:117: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/colorconvertor/ColorConverter.java:176: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/colorconvertor/ColorConverter.java:188: warning - @return tag has no arguments.
[WARNING] *-utils/src/main/java/*/colorconvertor/ColorConverter.java:202: warning - @return tag has no arguments.
[WARNING] Javadoc Warnings
[WARNING] *-api/src/main/java/*/ColorFinder.java:39: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/ColorFinder.java:49: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/ColorFinder.java:39: warning - @return tag cannot be used in method with void return type.
[WARNING] *-api/src/main/java/*/result/factory/ColorResultFactory.java:37: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/factory/ColorResultFactory.java:37: warning - @param argument "foundColor" is not a parameter name.
[WARNING] *-api/src/main/java/*/result/factory/ColorResultFactory.java:37: warning - @param argument "comparisonColor" is not a parameter name.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:37: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:43: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:55: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:67: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:79: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:85: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:91: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:109: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:121: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:103: warning - @param argument "color" is not a parameter name.
[WARNING] *-api/src/main/java/*/result/ColorCombinaison.java:115: warning - @param argument "color" is not a parameter name.
[WARNING] *-api/src/main/java/*/result/ColorResult.java:44: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorResult.java:50: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorResult.java:56: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorResult.java:62: warning - @return tag has no arguments.
[WARNING] *-api/src/main/java/*/result/ColorResult.java:74: warning - @return tag has no arguments.
[WARNING] Javadoc Warnings
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:65: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:82: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:91: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:134: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:143: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:161: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:170: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:179: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:188: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:198: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:220: warning - @return tag has no arguments.
[WARNING] *-impl/src/main/java/*/result/ColorCombinaisonImpl.java:125: warning - @param argument "threshold" is not a parameter name.
[WARNING] Javadoc Warnings
[WARNING] *-hsv/src/main/java/*/hsv/Boundary.java:60: warning - @return tag has no arguments.
[WARNING] *-hsv/src/main/java/*/hsv/ColorFinderHsv.java:224: warning - @return tag has no arguments.
[WARNING] *-hsv/src/main/java/*/hsv/ColorFinderHsvPsycho.java:302: warning - @return tag has no arguments.
[WARNING] *-hsv/src/main/java/*/hsv/ColorFinderRgb.java:245: warning - @return tag has no arguments.
[WARNING] Javadoc Warnings
[WARNING] *-webapp/src/main/java/*/webapp/controller/IndexController.java:96: warning - @return tag has no arguments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.