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

Allow users to use custom colors #2004

Open
66BA9Q-ME49 opened this issue Feb 11, 2025 · 0 comments
Open

Allow users to use custom colors #2004

66BA9Q-ME49 opened this issue Feb 11, 2025 · 0 comments

Comments

@66BA9Q-ME49
Copy link

Description

I saw in this comment on #1025 that you want to limit the available colors for tabs and panels to those of Firefox containers.

Could you at least add a way for users to select custom colors, either using a color picker or just by allowing users to enter a hex color code in a field?
I've looked at the code and it should be very easy to implement this feature.
In tab.vue#L104, if the value of tab.customColor is not a valid browser.ColorName, check if it is a valid HEX color and return that hex color if the check passes. Something like this:

if (tab.reactive.customColor) return RGB_COLORS[tab.customColor as browser.ColorName] || (/^#[0-9A-F]{6}$/i.test(tab.customColor) ? tab.customColor : undefined)

Then you just need to add an option in all the custom color dialogs (context menu, "configure panel in sidebar", "configure panel", ...) allowing the user to input a hex code.

Example

Image

I added the following in the devtools:

<div class="opt" data-selected="false" data-separator="false" title="Custom">
  <div class="icon-box">
    <svg class="icon">
      <use xlink:href="#circle"></use>
    </svg>
  </div>
  <div class="TextInput input" data-active="false" data-empty="true" data-valid="false" data-wrong="false" style="overflow: hidden">
    <div class="focus-fx"></div>
    <input autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" type="text" tabindex="-1" value="" />
    <div class="placeholder">HEX Color</div>
  </div>
</div>

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

No branches or pull requests

1 participant