Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement APCA Contrast #256

Open
facelessuser opened this issue Jan 6, 2023 · 12 comments
Open

Implement APCA Contrast #256

facelessuser opened this issue Jan 6, 2023 · 12 comments
Labels
P: maybe Pending approval of low priority request. S: triage Issue needs triage. T: feature Feature.

Comments

@facelessuser
Copy link
Owner

APCA (Accessible Perceptual Contrast Algorithm) is a new contrast algorithm. It currently targets replacing the WCAG 2.1 color contrast, or at least that is the intent. It has not done so yet, and there is no official WCAG 3 contrast.

The repo is here: https://github.com/Myndex/apca-w3.

The algorithm is pretty straightforward to implement and we have done so locally:

>>> from coloraide import Color
>>> text = Color('red')
>>> background = Color('blue')
>>> text.contrast(background, method='apca')
-20.313299765604636

We'd love to include this, but at this time, the license is so oppressive, that I do not think I could dare include it in an MIT project. The restrictions seem too constrained for me to do so.

I understand that they want to control the implementations to not leave a bad impression about the algorithm as they wish to gain good traction in regard to their claims. They also seem to be seeking some patents in regard to the algorithm. It's very confusing territory. They seem to want to make it publicly available, at least through browsers, but want to have extremely strict control. They've licensed it to the WCAG, but restrictions dictate it can only be used for the web. Our library can be used in whatever as there are no such restrictions for our current license in that regard, not for personal or commercial.

Some minor quibbles are related to their extremely strict requirement that if you use it, you must be exact in your implementation and must be up to date. I've never seen such requirements in a license before. I don't so much have a problem with ensuring the algorithm is accurate per se, but it seems they are trying to protect the APCA, or at least the claim of "compliance".

I do hope that if/when it becomes officially WCAG 3, whatever that iteration looks like, it will have a reasonable license attached to it at that time. That would allow distribution in our package much easier.

@facelessuser facelessuser added T: feature Feature. P: maybe Pending approval of low priority request. skip-review Tells bot to not tag a reviews with 'needs-review'. labels Jan 6, 2023
@gir-bot gir-bot added the S: triage Issue needs triage. label Jan 6, 2023
@facelessuser
Copy link
Owner Author

I was looking into this more. If I understand correctly, what we've implemented is covered under the W3 license. It "should" be safe to include with attribution. The one thing that I think still troubles me is the following restrictions applied on top of the W3 license.

DISCLAIMER AND LIMITATIONS OF USE:
apca-w3 is an embodiment of certain supra-threshold contrast prediction technologies and it is licensed to the W3 on a limited basis for use in WCAG accessibility guidelines for web content only. apca-w3 may be used for predicting contrast for web content used for that specific purpose without royalty.

Said license excludes other use cases not related to web content. Prohibited uses include medical, clinical evaluation, human safety related, aerospace, transportation, military applications, and uses which are not specific to web-based content presented on self-illuminated displays or devices.

The ability for them to audit isn't a problem as everything is public. Keeping up to date isn't that hard, if I'm aware, I'll update. But the above is pretty troublesome.

It specifically calls out a number of industries that can't use it. Our project does not restrict usage. Even more troubling and uses which are not specific to web-based content presented on self-illuminated displays or devices. I absolutely have no intention of restricting people to only use the tool in the way I tell them to use it. Indicating proper intention of use is one thing, but this sort of restriction poisons the project.

I assume when this is officially part of the W3 spec that such restrictions will no longer be in place for anything actively used by the W3.

It really is a shame that there isn't a way to properly utilize this, yet.

@facelessuser
Copy link
Owner Author

For now, I'll keep a private gist of the work in the hopes that we can one day add this. I don't plan on creating a separate repo with the above restrictions, but will evaluate in private for now 😞.

@facelessuser
Copy link
Owner Author

Sadly, DeltaPhiStar, created by the same person, is completely out of the question as it is released under AGPL and we cannot include it here. https://github.com/Myndex/deltaphistar

@facelessuser
Copy link
Owner Author

facelessuser commented Jan 19, 2023

Here is a playground with it working. https://facelessuser.github.io/coloraide/playground/?source=https%3A%2F%2Fgist.githubusercontent.com%2Ffacelessuser%2Fc1615dae555fdfe481b27ac99f1d9354%2Fraw%2Fapca.py

Obviously, it is restricted by the license: https://gist.github.com/facelessuser/c1615dae555fdfe481b27ac99f1d9354#file-license-md. This is also why we will not merge this in at this time, but I don't want to lose the work.

@Myndex
Copy link

Myndex commented Jan 25, 2023

Sadly, DeltaPhiStar, created by the same person, is completely out of the question as it is released under AGPL and we cannot include it here. https://github.com/Myndex/deltaphistar

Why is AGPL too restrictive for you? Because you're releasing under MIT license?

As for APCA–W3, eventually there will be a version under something like an MIT license.

@facelessuser
Copy link
Owner Author

@Myndex forgive my non-lawyer brain. I am not well-versed in AGPL. Is AGPL different than GPL in the sense that it doesn't require me to essentially restrict my project to the terms of AGPL?

@Myndex
Copy link

Myndex commented Jan 25, 2023

...Is AGPL different than GPL in the sense that it doesn't require me to essentially restrict my project to the terms of AGPL?

Hi @facelessuser -- at the moment the slightly restrictive licenses are in place but we are providing exceptions in writing on a pretty regular basis. We're not trying to stifle development/ adoption but we are trying to limit how fast these emerging technologies are being adopted, partly because there's still a lot of unsettled issues regarding emerging standards and so forth.

The rapid interest, popularity, and adoption took everybody by surprise, and the W3C & AGWG don't see WCAG 3 becoming a recommendation for a couple years.

That said I recognize the interest in a functional contrast method to help readability, and reasonable guidelines — so we're developing APCA DeltaPhiStar and so forth, as separate independent projects, but we are being careful about how it's going to be adopted and implemented at this time.

If you like, send an email to [email protected]

@facelessuser
Copy link
Owner Author

at the moment the slightly restrictive licenses are in place but we are providing exceptions in writing on a pretty regular basis. We're not trying to stifle development/ adoption but we are trying to limit how fast these emerging technologies are being adopted, partly because there are still a lot of unsettled issues regarding emerging standards and so forth.

@Myndex I completely understand, and this does make sense. I did read around at various places, so I did kind of come to the conclusion that APCA approach is still under research, etc. Don't take my grumblings as criticism, more me just realizing and working through that at this time I can experiment with it, but probably not something I can distribute publicly, or better stated, can only make available as a separate entity.

DeltaPhiStar looks interesting as well. My understanding was that if I include AGPL in my code, it will affect how people can use the MIT project. I could certainly be wrong, but if this is so, I cannot adopt the code unless I also adopt the AGPL license.

Regardless, your work in this area is very appreciated. I look forward to when one or more of these are more accessible.

@facelessuser
Copy link
Owner Author

Assuming that I'm wrong, and AGPL can live with MIT, if we are concerned with additional restrictions, we could implement it in https://github.com/facelessuser/coloraide-extras which is used to house experimental plugins. This would keep it out of the main distribution, and if/when it is safer to mainline it, we could migrate it back here.

@Myndex
Copy link

Myndex commented Jan 25, 2023

DeltaPhiStar should be labeled experimental, and any instantiation of APCA-W3 should be labeled as public beta "right now"

That said, DeltaPhiStar is on track to get a more permissive license first, as part of the reason I am releasing it right now is because APCA-W3 is on a protracted schedule due to the delays of WCAG3 and the changes that are going on right now.

Therefore, go ahead and start with DeltaPhiStar in your experimental folder if you like, using a D65 CIE Lstar (D65 should be default, D50 can be an option).

And just as an FYI even if your main project is MIT, you could have designated specific folders set to whatever their source license happens to be, so that you're not restricted to only MIT materials. For a variety of reasons the MIT license is problematic because of the scope and applications we're working on. MIT license is way too permissive for APCA-W3 right now, but it won't always be the case.

@facelessuser
Copy link
Owner Author

Yep, totally understand. Thanks for taking the time to comment!

@facelessuser
Copy link
Owner Author

Implemented a Delta Phi Star gist that can be found here: https://facelessuser.github.io/coloraide/playground/?source=https%3A%2F%2Fgist.githubusercontent.com%2Ffacelessuser%2F49f11edb4e9d9301f0a8140bf5087d84%2Fraw%2Fc88a626edeb34f6df500e271a145ec6a8ed8cf76%2Fdelta_phi_star.py#

Gist contains license: https://gist.github.com/facelessuser/49f11edb4e9d9301f0a8140bf5087d84

This will at least give me a starting point once licensing is more agreeable or we create a package that can be released under the license (maybe under the extras package, maybe not). The gist at least gives us the ability to experiment with the contrast approach.

@facelessuser facelessuser removed the skip-review Tells bot to not tag a reviews with 'needs-review'. label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: maybe Pending approval of low priority request. S: triage Issue needs triage. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

3 participants