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

use new Colour type for specials and gradients #1418

Merged
merged 5 commits into from
Feb 24, 2023

Conversation

bi4k8
Copy link
Collaborator

@bi4k8 bi4k8 commented Feb 23, 2023

Fixes #1417 and #1411.

Checklist

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

Description

This reinstates the gradient code that I forgot I'd commented out when introducing the pervasive Colour type, and translates nearby code (in specials and gradients) to use it. This simplifies a lot, removes hairy bit-masking and colour depth dependence, as well as dependencies on config and output initialization while computing special and gradient colors. It also makes it possible to use colour names like "red" in graphs, instead of only hex ones, as well as "#ffccaa" syntax with a pound sign (which was forbidden previously). This also enables running more of the gradient tests even in the compile-time absence of X11.

I tested visual appearance of graphs on a Wayland build using the config file from the upstream debian bug, as well as running ninja test.

bi4k8 added 2 commits February 23, 2023 01:41
our Colour type assumes this anyway; lower colour depth should be handled by display backends
this was mistakenly disabled when moving to a unified Colour representation
@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit fbfd90e
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/63f6c5bc85fff10008ba76b9

@github-actions github-actions bot added sources PR modifies project sources tests Issue or PR related to project tests labels Feb 23, 2023
bi4k8 added 3 commits February 23, 2023 01:47
colour computations no longer depend on the display backends we compile with, so these can be tested unconditionally now
this makes specials now accept color names as well as hex codes, and removes all notions of color depth from gradient calculations
@brndnmtthws brndnmtthws merged commit 5e98c49 into brndnmtthws:main Feb 24, 2023
@brndnmtthws brndnmtthws added the bug Bug report or bug fix PR label Mar 4, 2023
simotek pushed a commit to simotek/conky that referenced this pull request Apr 5, 2023
* gradient, colours: use 24-bit colour depth internally on Wayland

our Colour type assumes this anyway; lower colour depth should be handled by display backends

* core: restore gradient color computation

this was mistakenly disabled when moving to a unified Colour representation

* core, gradient: use Colour type

* tests: gradient: always test hsv/hcl

colour computations no longer depend on the display backends we compile with, so these can be tested unconditionally now

* gradients, specials: use Color type

this makes specials now accept color names as well as hex codes, and removes all notions of color depth from gradient calculations

---------

Co-authored-by: bi4k8 <bi4k8@github>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR sources PR modifies project sources tests Issue or PR related to project tests
Projects
None yet
2 participants