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

Numerical values passed as list of strings incorrectly treated as colors #601

Open
Sija opened this issue Feb 17, 2024 · 2 comments
Open
Labels

Comments

@Sija
Copy link

Sija commented Feb 17, 2024

Image is worth a thousand words, so here it goes:

image
const object = {
  "ISO Speed": "3200",
};
const options = {
  "100": "100",
  "125": "125",
  "160": "160",
  "200": "200",
  "250": "250",
  "320": "320",
  "400": "400",
  "500": "500",
  "640": "640",
  "800": "800",
  "1000": "1000",
  "1250": "1250",
  "1600": "1600",
  "2000": "2000",
  "2500": "2500",
  "3200": "3200",
  "4000": "4000",
  "5000": "5000",
  "6400": "6400",
  "8000": "8000",
  "10000": "10000",
  "12800": "12800",
  "16000": "16000",
  "20000": "20000",
  "25600": "25600",
  "Auto": "Auto",
};

pane.addBinding(object, "ISO Speed", { options });
pane.addBinding(object, "ISO Speed", { view: "list", options }); // doesn't work either
@cocopon
Copy link
Owner

cocopon commented Feb 17, 2024

This is caused by a bug of parsing color string.

/^#?([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/,

'3200' should not be parsed as a color string, but it is. I'll fix it later.

@cocopon
Copy link
Owner

cocopon commented Feb 18, 2024

Fixed, please wait for the next release.

@cocopon cocopon closed this as completed Feb 18, 2024
@cocopon cocopon reopened this Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants