Skip to content
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

Check whether first_colour is set before using it as foreground color #2153

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

livanh
Copy link
Contributor

@livanh livanh commented Feb 2, 2025

Checklist

  • I have described the changes
  • I have linked to any relevant GitHub issues, if applicable
  • Documentation in doc/ has been updated
  • All new code is licensed under GPLv3

Description

For several months now, the first color of a graph's gradient is also being used as the foreground color, but without properly checking whether the gradient colors are actually set. If they are not, the scale text of the graph is set to black instead of the default color:
immagine

With this change, the scale text correctly follows the default color:
immagine

(I don't think the documentation needs an update, but I will do it if requested)

@github-actions github-actions bot added the sources PR modifies project sources label Feb 2, 2025
Copy link

netlify bot commented Feb 2, 2025

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit 1ce1f61
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/679eb613d3f18a0008f045f1

@Caellian Caellian added enhancement suggests alteration of existing functionality to better support different use cases rendering related to code that handles rendering, excluding the used graphics API labels Feb 3, 2025
Comment on lines -1401 to +1404
// Set the foreground colour to the first colour, ensures the scale text is always drawn in the same colour
set_foreground_color(current->first_colour);
if (current->colours_set) {
// Set the foreground colour to the first colour, ensures the scale text is always drawn in the same colour
set_foreground_color(current->first_colour);
}
Copy link
Collaborator

@Caellian Caellian Feb 3, 2025

Choose a reason for hiding this comment

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

LGTM

@Caellian Caellian merged commit 35c5a05 into brndnmtthws:main Feb 3, 2025
38 checks passed
@Caellian
Copy link
Collaborator

Caellian commented Feb 3, 2025

@livanh thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement suggests alteration of existing functionality to better support different use cases rendering related to code that handles rendering, excluding the used graphics API sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants