Skip to content

Contrast fix #908

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/Nav/styles.module.scss
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I also noticed that the contrast between the annotations and the background color needs to be adjusted.

截圖 2025-07-28 晚上9 58 25

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll take a look at that and get back to you soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @coseeian — I realized there was a small improvement I probably should have included in the function color fix. Using *= like this:

code span[style*="#D73A49"] {
color: #000 !important;
}
makes the selector more flexible. I noticed a couple of the function keywords were still showing up pinkish which made me want to try this fix.

That said, if some text is supposed to stay that color, feel free to let me know — this might not be the right adjustment in that case.

I also tweaked the annotation styling to make it a bit darker — I assumed you were referring to the // circle in the center..... (in your picture above)

BTW, you’ll see both changes reflected in the Files Changed tab.

Let me know if you need anything else. Thanks!!

Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,7 @@
margin-top: 10px;
}

/* Force 'function' keyword to have better contrast */
code span[style*="#D73A49"] {
color: #000 !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ function draw() {

By default, `p5.Framebuffer`s are not drawn to the screen. The main canvas is the only thing shown at the end of `draw()`. To make the contents of a `p5.Framebuffer` visible, it has to be stamped upon the main canvas. This is typically done with a call to `image(yourFramebuffer, x, y, width, height)`. Similar to the main canvas, a `p5.Framebuffer` only gets cleared when you ask it to be cleared, so you can stamp it on the main canvas as many times as you want, like in the example below.

<AnnotatedCode lang="javascript" columns={true} code={({ begin, end }) =>
<AnnotatedCode
lang="javascript"
columns={true}
theme="light-plus"
code={({ begin, end }) =>
`${begin('header')}

${end('header')}
Expand Down