Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • extensions extensions
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 77
    • Issues 77
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Inkscape
  • extensionsextensions
  • Merge requests
  • !392

Give ColorExtensions the option of processing in RGBA space

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jonathan Neuhauser requested to merge joneuhauser/extensions:rgba-color-extension into master Jan 17, 2022
  • Overview 9
  • Commits 9
  • Pipelines 6
  • Changes 10

As described in #419 (closed), the ColorExtension API called the function for processing of colors and opacities separately, so one didn't know about the other.

This API change allows extensions to override the pass_rgba static class variable, which makes the modify_color method receive an RGBA color and write a returned RGBA value back into the style. For this purpose, pairs of properties {"fill" : "fill-opacity", "stroke" : "stroke-opacity", "stop-color" : "stop-opacity"} are considered.

It also makes use of the relatively new Style API, which led to a test fail of the randomize extension because more color values were processed (and thus leading to different random results). So for the unit tests, the _rand function is now deterministic (it sets the seed to the value being changed, so everytime this value is passed, the same random result is returned).

So much for an explanation of the seemingly unrelated changes; I couldn't get the unit tests to pass otherwise.

Closes #419 (closed)

Edited Jan 17, 2022 by Jonathan Neuhauser
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: rgba-color-extension