-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Change Reference Example #7280
Change Reference Example #7280
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page! |
Thanks @samarsrivastav for working on it. Tagging @aleannab and @davepagurek to review this PR. |
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.
Thanks @samarsrivastav for your work, it's a great work and thanks @aleannab for rasing and explaing the issue with solution. What I feel the sketch @aleannab mentioned has only used two colors for all the types of blendMode. They are #1a85ff and #d41159.
However in the examples if I do grunt yui:dev I can see the noticable difference with the examples.
What I see that you have used the set of colors from here: (in the refrence) which is actually the resultant colors. :")
We can fix this by using the appropriate colors ('#1a85ff' and '#d41159') for them, and can add other blendModes which are removed i.e. "ADD" and "DARKEST" (with different color sets). Otherwise looks good. :)
* | ||
* // Set the blend mode. | ||
* blendMode(ADD); | ||
* blendMode(HARD_LIGHT); |
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.
I noticed that you removed two example sketches:
blendMode(ADD)
blendMode(DARKEST)
I think we could keep these examples. What do you think?
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.
Hey @perminder-17 !! I have added these two as well, is there any sort of order we need to follow while adding all the blendmodes?
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.
Hey @perminder-17 !! I have added these two as well, is there any sort of order we need to follow while adding all the blendmodes?
No, i don't think so. Its just that we need to help users learn about blendMode() so it could be in any order.
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.
sure
src/core/rendering.js
Outdated
@@ -728,7 +728,7 @@ p5.prototype.clearDepth = function(depth) { | |||
* final color results from blending the source pixel's color with the canvas | |||
* pixel's color. RGB color values from the source and canvas pixels are | |||
* compared, added, subtracted, multiplied, and divided to create different | |||
* effects. Red values with red values, greens with greens, and blues with | |||
* effects. #d41159 values with #d41159 values, greens with greens, and blues with |
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.
Shouldn't this stay red, as this statement refers to the color channels, not the color of the line?
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.
Good catch!
src/core/rendering.js
Outdated
* line(75, 25, 25, 75); | ||
* | ||
* describe('A blue line and a red line form an X on a gray background.'); | ||
* describe('A #1a85ff line and a #d41159 line form an X on a gray background.'); |
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.
In order to be more screen reader-accessible, I suggest we are more descriptive with the new color values instead of using hex codes like #d41159. For example, here we could say "A vibrant pink line and a bright blue line..."
This comment would be applicable to all the describe statements for the blend mode examples.
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.
Hey @aleannab, I completely understand the need to use color names, but I’m a bit uncertain about the best way to name these specific colors. Could you provide some guidance on how to approach this? I’d really appreciate your help!
Ah, yes, in the original reference I used '#1a85ff' and '#d41159' for all the examples. The colors in the table are the resulting colors after the blend mode has been applied. I provided those to highlight the differences in the before and after. Here's example of how I generated the reference images: This is how the end results should show, as I mentioned in the original issue. |
Aaah...yess. I see, I think currently we are using the resulting colors rather than the colors you mentioned in the refrence i.e. '#1a85ff' and '#d41159'. We should use these colors only rather than resulting one. I just now noticed in the issue haha. Thanks @aleannab I'll now edit my review so that @samarsrivastav could work on it. Thanks:) |
Kind of along the same note: I think we should change the REPLACE, REMOVE, and SUBTRACT examples to use these colors as well. The only reason why I didn't include it in my original reference was because I could only use these in WEBGL mode (and others only in 2D mode). |
Yes, sure thing. I checked these three modes too, and the colors you mentioned work great. |
Hey @perminder-17 and @aleannab, I've resolved the color issue and added the colors as per the example provided here. However, I'm still uncertain about how to best name these colors. I'd appreciate any guidance you can offer on the naming part! |
I’ve used an AI assistant to generate color names for my reference. Could you please take a look and let me know your thoughts?
|
hey, thanks. Looks correct.
Yes, in my opinion, if you're referring to the color dodgerblue, its color code is We could just use the color code in the discription saying for eg.
similarly for other colors, we can say, {
blendMode: 'DODGE',
description: 'A `#c8ffff` (from the image shared below) and a `ffc1ff` line form an X on a gray background.
The area where they overlap is (the results after calculations).' // need to calculate the overlap color
}, To find the exact colors (resultant) that we get after blending, here are the final colors produced. The reasons I'm not focusing on the color names are:
For calculating the exact colors overlapped, you can calculate from the formulas Or you may use ai for the calculations, since it's probably very good at calculations haha. Let me know what are your thoughts. |
One last thought: as @aleannab mentioned, can we use the same two colors, (1a85ff and d41159), in the blendMode(SUBTRACT)? I believe you're currently using blue and red, correct? |
I also agree that the exact color names aren't super important. However, considering that the describe function is for screen reader accessibility for blind or visually impaired users to read the text, I think that having semi-descriptive color names (e.g. pale blue vs. aqua) are more useful than hex codes. It does get tricky though since many of the colors do look similar. Maybe one of the Accessibility Stewards can weigh in with their thoughts? @Qianqianye @calebfoss, @cosmicbhejafry, @apoorva-a98, @tedkmburu, @Zarkv, @SkylerW99, @itsjoopark, @hannahvy, @nhasalajoshi |
Ah, I was using the same two colors (1a85ff and d41159) across the board. I agree that makes sense! |
Certainly! I will ensure that the same colors are used consistently across all blend mode examples. One final clarification I’d like to make, regarding the issue:
@aleannab and @perminder-17, please give a thumbs up if you feel this is the approach, and I will proceed with committing the changes. |
Thanks @samarsrivastav ! Thumbs up to the first item! Let's wait on the color names for describe() until one of the Accessibility stewards can give their opinion. |
Sounds good! |
Hi! I'm not an accessibility steward, but assuming the descriptions are intended for humans using screen readers, we probably should be using some kind of human-readable color in the description. Ideally we've picked input colors that make the visual differences between e.g. ADD and DODGE different enough that we can describe them as something like "blue" vs "lighter blue", but since that sounds hard to achieve across the board, I think it's ok if not all the described colours are distinct from each other. |
Thanks for the response @davepagurek
I think you can go with the naming instead of the codes in order to describe them. @samarsrivastav . Thanks for your work. |
Thank you @davepagurek and @perminder-17! If this helps, @samarsrivastav , I have the following table (with ChatGPT doing the heavy lifting). Feel free to make adjustments as you see fit. I gave ChatGPT the image I posted in the original issue.
|
Looks awesome. Thanks:) |
@perminder-17 and @aleannab, I have committed the changes. Kindly review them and share your feedback at your earliest convenience. |
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.
Thanks @samarsrivastav! This is extremely nit-picky, but there's inconsistency throughout regarding capitalization of color names. Following the format of the original example, all colors should be lowercase, unless it's at the start of a sentence. If @perminder-17 doesn't see anything else, I think we should be good to go!
src/core/rendering.js
Outdated
@@ -812,7 +812,7 @@ p5.prototype.clearDepth = function(depth) { | |||
* stroke('#d41159'); | |||
* line(75, 25, 25, 75); | |||
* | |||
* describe('A faint #1a85ff line and a faint #d41159 line form an X on a gray background. The area where they overlap is #B518B2.'); | |||
* describe('An Ocean Blue line and a Hot pink line form an X on a gray background. The area where they overlap is Magenta purple.'); |
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.
There is inconsistency in capitalization of color names (e.g. "Ocean Blue" vs. "Hot pink") here, and across all the examples.
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.
all colors should be lowercase, unless it's at the start of a sentence
Good catch!
I think we are good to go....could be the last bit only. Thanks.
src/core/rendering.js
Outdated
@@ -1247,7 +1247,7 @@ p5.prototype.blendMode = function(mode) { | |||
* // Draw the circle. | |||
* circle(50, 50, 40); | |||
* | |||
* describe('A fiery sun drawn on a light blue background.'); | |||
* describe('A fiery sun drawn on a light #1a85ff background.'); |
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.
* describe('A fiery sun drawn on a light #1a85ff background.'); | |
* describe('A fiery sun drawn on a light blue background.'); |
Maybe the last bit. This change you have made on the drawingContext
method. So this can be reverted to it's color name.
@perminder-17, I apologize for the oversight earlier. I've reverted to the original naming and ensured that all color names are now consistently in lowercase. |
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.
This is the last bit. Otherwise we are good to go!
Co-authored-by: Perminder Singh <[email protected]>
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.
Looks good! Thanks for your work @samarsrivastav and thanks for the review @aleannab
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.
Thanks everyone!
Yay @samarsrivastav! And thank you @perminder-17 and @davepagurek! |
Resolves #7228
Changes:
Screenshots of the change:
npm run lint
passes