Skip to content

Let the GUI colors be choosen via hex values - #4738

Merged
borgmanJeremy merged 5 commits into
flameshot-org:masterfrom
IndolikarQuantifier:gui_color_choosen_via_hex_values
Jun 26, 2026
Merged

borgmanJeremy merged 5 commits into
flameshot-org:masterfrom
IndolikarQuantifier:gui_color_choosen_via_hex_values

Conversation

@IndolikarQuantifier

@IndolikarQuantifier IndolikarQuantifier commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

This will add functionality to set color values from hex input.

image image

@mmahmoudian

Copy link
Copy Markdown
Member

@IndolikarQuantifier
Looks good to me, but please add a text above the textbox to clarify what the textfield is representing. Not all users are tech savvy enough to know what a hexadecimal color code is. Also you are allowing alpha to be set. Please reflect that in the text too, so that users know they also have the option.

@IndolikarQuantifier

Copy link
Copy Markdown
Contributor Author

@IndolikarQuantifier Looks good to me, but please add a text above the textbox to clarify what the textfield is representing. Not all users are tech savvy enough to know what a hexadecimal color code is. Also you are allowing alpha to be set. Please reflect that in the text too, so that users know they also have the option.

I have added label for hex text box.
Also the hex values represents RGB and it doesn't contain alpha.

Comment thread src/config/uicoloreditor.cpp Outdated

void UIcolorEditor::changeInputColor(const QString& hexColor) {

if(hexColor.contains(QRegularExpression("^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also the hex values represents RGB and it doesn't contain alpha.

Your regular expression suggests the opposite! You are explicitly allowing a hex value with either 6 OR 8 characters which would be #RRGGBB or #AARRGGBB (A = alpha) 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh that's right I have updated the regex so that it will accept only RGB values

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I noticed an issue during my test: If I insert a (valid) hex value into the textbox, the color is not used/applied! For me it is still using the previous color. I think you have to connect to slot UIcolorEditor::updateUIcolor to apply the input.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved this issue

@IndolikarQuantifier

Copy link
Copy Markdown
Contributor Author

Hi @mmahmoudian
who's review is required to merge this PR.

@mmahmoudian

Copy link
Copy Markdown
Member

@IndolikarQuantifier

who's review is required to merge this PR.

Although @ElTh0r0 kindly approved the PR and I also reviewed it, I believe we still need to hear @borgmanJeremy opinion on the matter. Thanks for your patience.

@borgmanJeremy borgmanJeremy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks!

@borgmanJeremy

Copy link
Copy Markdown
Collaborator

Once the clang-format failures are addressed we can merge. Thanks for your patience.

@IndolikarQuantifier

Copy link
Copy Markdown
Contributor Author

Once the clang-format failures are addressed we can merge. Thanks for your patience.

Thansk for review
I have made changes to pass clang-format check

@IndolikarQuantifier

Copy link
Copy Markdown
Contributor Author

can you please merge this PR @mmahmoudian @borgmanJeremy

@borgmanJeremy

Copy link
Copy Markdown
Collaborator

Thank you!

@borgmanJeremy
borgmanJeremy merged commit 6a635d2 into flameshot-org:master Jun 26, 2026
20 checks passed
@mmahmoudian mmahmoudian added this to the v15 milestone Jul 5, 2026
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.

4 participants