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

PAINTROID-737: Add Pipette Tool #78

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from

Conversation

bhav-khurana
Copy link
Contributor

Ticket

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.

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)
  • Make sure to organize imports with 'make sort' before committing
  • 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

@bhav-khurana
Copy link
Contributor Author

bhav-khurana commented Jun 7, 2024

Hi @juliajulie95 @msesko @bakicelebi
I have implemented the pipette tool but there is one issue I'm facing that whenever I click on a color in the pipette tool screen and reuse it, it does not match exactly the one that is on the drawing canvas. I am not able to figure out if anything is missing/wrong in the code. Can you please help me out in finding out where exactly the bug might be occurring?

@bakicelebi
Copy link
Contributor

Hi Bhav, I could not reproduce the problem you are having. But i found another similar issue. Transparent colors while drawing are darker. Only after onUp when the command is executed the transparency is correct. And the problem you are describing is happening only when the colors are transparent. I am guessing there is an underlying issue with the color picker and not the pipette tool itself. I will have to have a deeper look but for now few suggestions:

  1. Opening a page should be not necessary. We should keep the same flow as native version of the app. (Instantly selecting the color under the finger)
  2. Enable ModalBottomSheet pipette tool it still defaults to brush tool
  3. This is more of an color picker issue but with my specific emulator (small screen size) the apply button is not visible and is very hard to scroll down

Screenshot_1718318200

@bhav-khurana
Copy link
Contributor Author

bhav-khurana commented Jun 16, 2024

This is more of an color picker issue but with my specific emulator (small screen size) the apply button is not visible and is very hard to scroll down

For this, should I enable scrolling so that the apply button becomes visible? or reduce the size of each component

@bakicelebi
Copy link
Contributor

bakicelebi commented Jun 19, 2024

This is more of an color picker issue but with my specific emulator (small screen size) the apply button is not visible and is very hard to scroll down

For this, should I enable scrolling so that the apply button becomes visible? or reduce the size of each component

It is already scrollable but it is really hard. I think this can be fixed in color picker PR. Imo we can do bit compacter dynamic design so that the scrolling of bottomsheet is never activated.

Copy link
Contributor

@Lenkomotive Lenkomotive left a comment

Choose a reason for hiding this comment

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

pls fix conflicts

@bhav-khurana
Copy link
Contributor Author

@Lenkomotive fixed conflicts

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class PipetteToolPage extends ConsumerStatefulWidget {
Copy link
Contributor

Choose a reason for hiding this comment

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

Opening a new page for pipette tool is overkill. As mentioned in my previous comment the kotlin version of Pocket Paint doesnt open a new page. You can approach this tool the easiet way:

  1. onTap -> get color of the pixel under the point
  2. set paint color to that color using paint provider

This simplyfies the user experience and matches the original implementation of the tool and removes alot of unnessary code.

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.

3 participants