-
Notifications
You must be signed in to change notification settings - Fork 82
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
[contrast] Add contrast methods #194
Conversation
@LeaVerou any thoughts so far? |
I added documentation. Currently using the procedural API as the functions have not been object-oriented |
Checking for Y=0 is certainly worthwhile as this is likely to be common. These changes would affect Weber and Michelson Negative Y is unlikely but possible and, as you said, clamping to 0 seems best. That would affect anything luminance-based. |
Co-authored-by: Lea Verou <lea@verou.me>
Co-authored-by: Lea Verou <lea@verou.me>
So I have export default function contrastAPCA(foreground, background) { and then export function register(Color) {
Color.defineFunction("contrastAPCA", contrastAPCA);
} but what I really want is to end up with Color.contrastAPCAText(background);
Color.contrastAPCABackground(foreground); which will produce contrastAPCA(this, background);
contrastAPCA(foreground, this); respectively. |
I assume you mean I don't think this is a good design. Long method names are hard to read, and if I see To borrow from the proposed keywords for
|
It seems pretty important at this stage to include at minimum APCA in the method name as well (and may be too soon to call it that, rather than APCA-0.0.98G) |
Added tests for the APCA function, based on eight known-good results from the apca-w3 test. Seven are passed (to all significant figures) one is not, and I believe his test is incorrect |
Eighth APCA test confirmed wrong, corrected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We need to add a color.contrast(color, methodname)
method though. Could be done in a separate PR.
Done:
ToDo: