Skip to content

PAINTROID-737 Add pipette tool to the colorpicker package - #138

Merged
juliajulie95 merged 2 commits into
Catrobat:developfrom
Amit-Matth:PAINTROID-737
Jul 28, 2026
Merged

PAINTROID-737 Add pipette tool to the colorpicker package#138
juliajulie95 merged 2 commits into
Catrobat:developfrom
Amit-Matth:PAINTROID-737

Conversation

@Amit-Matth

@Amit-Matth Amit-Matth commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds a pipette tool to the color picker, allowing users to pick a color directly from the canvas.

PAINTROID-737

New Features and Enhancements

As present in the native application, a pipette tool for selecting a particular color from the current state of the drawing canvas is implemented. This tool is a part of the colorpicker package itself and allows the user to pick any color from the drawing and use it on other objects.

  • Pipette Integration: Added PipetteToolButton to the ColorPicker UI, enabling navigation to the color selection interface.
  • Pipette Page: Developed PipettePage to render a screen snapshot and extract colors using ui.Image byte data.
  • Precision Loupe: Implemented a magnifying loupe with a crosshair for accurate color picking during pan gestures.
  • Confirmation Flow: Added a "Save changes?" dialog to ensure picked colors are not lost when navigating back without confirmation.
  • Testing: Created a robust test suite in pipette_button_test.dart covering UI alignment, navigation, color selection, loupe visibility, and dialog interactions.

Refactorings and Bug Fixes

  • Refactorings and Bug Fixes

Checklist

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Add the link to the ticket in Jira in the description of the PR
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines (Wiki)
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Add new information to the Wiki

@juliajulie95

Copy link
Copy Markdown
Contributor

Hi there! Please add the text to the newly merged translation file (or use the already existing ones in there)

Comment thread packages/colorpicker/lib/src/components/pipette_tool_button.dart Outdated
Comment thread packages/colorpicker/lib/src/pages/pipette_page.dart Outdated
Comment thread packages/colorpicker/lib/src/components/top_bar.dart Outdated
Comment thread packages/colorpicker/lib/src/pages/pipette_page.dart Outdated
@Amit-Matth
Amit-Matth force-pushed the PAINTROID-737 branch 2 times, most recently from b0af3de to f6ce2f0 Compare July 23, 2026 16:31
@Amit-Matth
Amit-Matth requested a review from juliajulie95 July 23, 2026 23:57
@juliajulie95

juliajulie95 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for the changes
I tested it on a Google Pixel 10 and it didn't work like intended. The position was off

PAINTROID-737.mp4

- Add pipette tool text to translation files

- Optimize PipettePage performance by caching Image ByteData

- Remove unused TopBar component

- Fix test environment timeout constraints for async operations
@Amit-Matth

Copy link
Copy Markdown
Contributor Author

Thanks for the changes I tested it on a Google Pixel 10 and it didn't work like intended. The position was off

PAINTROID-737.mp4

Thanks for testing! The PR description was actually a bit misleading - the old UI was just a solid color preview, not a real magnifier, which is why aiming with it felt off.

I just pushed a fix to make it a true magnifying glass. It now actually zooms in, and the crosshair perfectly targets the pixel. Give the latest commit a try!

@Amit-Matth

Copy link
Copy Markdown
Contributor Author

Also, I noticed the CI failed on the spray_tool_test, but as you can see in the screenshot below, it actually passed perfectly on my fork's CI for the exact same commit. It looks like it was just a random flake with the spray tool test and isn't related to my changes.

Rerunning the failed CI job will clear the error and pass successfully!

Screenshot 2026-07-24 200254

@juliajulie95

Copy link
Copy Markdown
Contributor

Hi! Don't worry about the test, one of our team members is already looking into it

@Amit-Matth

Copy link
Copy Markdown
Contributor Author

Hi! Don't worry about the test, one of our team members is already looking into it

Thanks for letting me know!

@juliajulie95

Copy link
Copy Markdown
Contributor

Works now! Thank you very much!

@juliajulie95
juliajulie95 merged commit f2cbb17 into Catrobat:develop Jul 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants