-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-138772: Improve documentation for turtle color functions #139325
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
serhiy-storchaka
wants to merge
1
commit into
python:main
Choose a base branch
from
serhiy-storchaka:turtle-color-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−11
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use multiple signatures for clarity. Explain different forms of bgcolor() in details.
26df454
to
78c3b27
Compare
encukou
reviewed
Oct 7, 2025
Comment on lines
+1890
to
+1909
Four input formats are allowed: | ||
|
||
``bgcolor()`` | ||
Return the current background color as color specification string or | ||
as a tuple (see example). May be used as input to another | ||
color/pencolor/fillcolor/bgcolor call. | ||
|
||
``bgcolor(colorstring)`` | ||
Set the background color to *colorstring*, which is a Tk color | ||
specification string, such as ``"red"``, ``"yellow"``, or ``"#33cc8c"``. | ||
|
||
Set or return background color of the TurtleScreen. | ||
``bgcolor((r, g, b))`` | ||
Set the background color to the RGB color represented by the tuple of | ||
*r*, *g*, and *b*. | ||
Each of *r*, *g*, and *b* must be in the range 0..colormode, where | ||
colormode is either 1.0 or 255 (see :func:`colormode`). | ||
|
||
``bgcolor(r, g, b)`` | ||
Set the background color to the RGB color represented by *r*, *g*, and *b*. Each of | ||
*r*, *g*, and *b* must be in the range 0..colormode. |
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.
Do you think it could it be better to link to a more commonly used function, rather than repeat all the info?
Suggested change
Four input formats are allowed: | |
``bgcolor()`` | |
Return the current background color as color specification string or | |
as a tuple (see example). May be used as input to another | |
color/pencolor/fillcolor/bgcolor call. | |
``bgcolor(colorstring)`` | |
Set the background color to *colorstring*, which is a Tk color | |
specification string, such as ``"red"``, ``"yellow"``, or ``"#33cc8c"``. | |
Set or return background color of the TurtleScreen. | |
``bgcolor((r, g, b))`` | |
Set the background color to the RGB color represented by the tuple of | |
*r*, *g*, and *b*. | |
Each of *r*, *g*, and *b* must be in the range 0..colormode, where | |
colormode is either 1.0 or 255 (see :func:`colormode`). | |
``bgcolor(r, g, b)`` | |
Set the background color to the RGB color represented by *r*, *g*, and *b*. Each of | |
*r*, *g*, and *b* must be in the range 0..colormode. | |
The arguments use the same format as :func:`fillcolor`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting core review
docs
Documentation in the Doc dir
needs backport to 3.13
bugs and security fixes
needs backport to 3.14
bugs and security fixes
skip news
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use multiple signatures for clarity.
Explain different forms of bgcolor() in details.
📚 Documentation preview 📚: https://cpython-previews--139325.org.readthedocs.build/