Skip to content

Conversation

@Taffer
Copy link
Contributor

@Taffer Taffer commented Apr 11, 2021

This makes it easier (hopefully) to find pygame.Color()'s ability to use named colours, and also provides a page listing each, with a sample colour swatch.

Tested with Sphinx 3.5.3 and Firefox 87.0.

This addresses #2550.

Copy link
Contributor

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

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

Cool work on the color swatches page, that's great!

I think it would be best to keep color.rst more similar to how it was, with the named color being one of the possible color formats under Supported color_value formats like every other format.

That being said, you could replace the link to the colordict source code with the link to your color swatches page.

I think it would also be nice to have a link to the color swatches page in the colordict source code and vice versa, so that any future editors to those files remember the existence of the other.

Also: the mystery in this PR is why the new page doesn't show up in the pygame documentation top of the page header, because new files are added to that automatically... Something in the format?

Note to anyone building the documentation (illume) This page seems to need sphinx 3 and up to date docutils (more than other pages), although I haven't tested it intensively.

Tweaked slightly to (hopefully) make it show up in the right spot in the
top-of-page docs. Also sorted gray and grey properly.
@Starbuck5
Copy link
Contributor

Starbuck5 commented Apr 13, 2021

Ah, sorry I was unclear. I was happy that this doesn't show up in the top bar, I just wondered why. Since I've dabbled in hiding modules before, like in #2511.

I'd also like to have the link to pygame/pygame/blob/master be changed to pygame/pygame/blob/main since we switched default branch naming.

Copy link
Contributor

@Starbuck5 Starbuck5 left a comment

Choose a reason for hiding this comment

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

Cool! Hopefully this will be helpful to people.

@Starbuck5
Copy link
Contributor

On second look, I see some colors are incorrect.

For example all the golds are just black, same as all the darkoranges, and the greens, for example.

@Taffer
Copy link
Contributor Author

Taffer commented Apr 19, 2021

On second look, I see some colors are incorrect.

For example all the golds are just black, same as all the darkoranges, and the greens, for example.

That's extremely weird, since Python wrote most of the file; I'll look into it though! Which browser are you using?

Looks like a bunch of things are showing up black (cyan starts a block of them). Inspecting the element suggests the CSS is mucked up, so I'll verify it against the colordict values.

@Starbuck5
Copy link
Contributor

I'm using Chrome, but I don't think it would matter?

The one's that I'm talking about, on examination of the rst file, only have background-color: missing the color that most other ones have.

@Taffer
Copy link
Contributor Author

Taffer commented Apr 19, 2021

The issue was incorrectly translating colours with values less than 16 in one or more components; a lot of colours were affected. I inspected the entire rendered page and everything looks good now.

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

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

Fun :) Thanks.

@illume illume merged commit fa4391d into pygame:main May 22, 2021
@illume illume added color pygame.color docs labels Aug 21, 2021
@illume illume added this to the 2.0.2 milestone Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

color pygame.color docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pygame.colordict is (almost) undocumented

3 participants