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

Theme url with background lightness of 0 causes js error #159

Open
mminglis opened this issue May 12, 2022 · 0 comments
Open

Theme url with background lightness of 0 causes js error #159

mminglis opened this issue May 12, 2022 · 0 comments
Labels
bug Something isn't working UI Issues related to the Leonardo web interface

Comments

@mminglis
Copy link

Description

If lightness value is set to 0, the theme URL causes the following js error:

Uncaught Error: unknown hex color: undefined
    at hex2rgb$1 (chroma.js:804:1)
    at new Color (chroma.js:183:1)
    at chroma$k (chroma.js:204:1)
    at Theme._findContrastColors (theme.js:218:1)
    at Theme.set lightness [as lightness] (theme.js:67:1)
    at paramSetup (params.js:99:5)
    at Object.parcelRequire.m3VC.@spectrum-css/vars/dist/spectrum-global.css (theme.js:219:1)
    at newRequire (index.js:1:404)
    at index.js:1:637
    at index.js:1:1413
chroma.js:804 Uncaught (in promise) Error: unknown hex color: undefined
    at hex2rgb$1 (chroma.js:804:1)
    at new Color (chroma.js:183:1)
    at chroma$k (chroma.js:204:1)
    at Theme._findContrastColors (theme.js:218:1)
    at Theme.set output [as output] (theme.js:170:1)
    at createOutputParameters.js:37:5
colorWheel.js:246 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getContext')
    at createColorWheel (colorWheel.js:246:19)
    at colorWheel.js:352:5

Steps to reproduce

  1. Go to https://leonardocolor.io/theme.html
  2. Open "Theme Settings" dialog and change lightness slider to 0%
  3. Open "Share" dialog and copy theme url
  4. Paste theme url in a new tab

Environment

All browsers on Macos 12.3.1

@mminglis mminglis added bug Something isn't working UI Issues related to the Leonardo web interface labels May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI Issues related to the Leonardo web interface
Projects
None yet
Development

No branches or pull requests

1 participant