HomePhabricator
Diffusion Comm ca3e988feeba

[web] Use `tinycolor.equals(a, b)` in `ColorSelectorButton`

Description

[web] Use tinycolor.equals(a, b) in ColorSelectorButton

Summary:
Replace .toLowercase() string comparison with tinycolor2.equals() which handles that + # prefix existing/missing + 3 char vs 6 char vs 8 char hex etc. for us. Not that we expect to run into those here, but it seems like a more "robust" way to do color comparison?


Depends on D3700 (I guess)

Test Plan:
Things continue to work as expected.

  1. Opened ThreadSettingsModal
  2. Selected a color
  3. Hit save and ensured the thread color was changed to the selected color

Reviewers: palys-swm, def-au1t, benschac

Reviewed By: palys-swm, benschac

Subscribers: ashoat, Adrian, karol-bisztyga, yayabosh

Differential Revision: https://phabricator.ashoat.com/D3701

Details

Provenance
atulAuthored on Apr 11 2022, 12:07 PM
Reviewer
tomek
Differential Revision
D3701: [web] Use `tinycolor.equals(a, b)` in `ColorSelectorButton`
Parents
rCOMM207547893bef: [web] Add `tinycolor2` to `web/package.json`
Branches
Unknown
Tags
Unknown