Skip to content

Fix colour values from external variables in Content.setValuePopupData#893

Open
davidhealey wants to merge 1 commit intochristophhart:developfrom
davidhealey:externalVariablePopupData
Open

Fix colour values from external variables in Content.setValuePopupData#893
davidhealey wants to merge 1 commit intochristophhart:developfrom
davidhealey:externalVariablePopupData

Conversation

@davidhealey
Copy link
Copy Markdown
Contributor

When using Content.setValuePopupData I wanted to use colours and other properties that are stored in variables or retrieved using functions.

ValuePopup::Properties::getColour used ObjectWithDefaultProperties::getColourFrom which does a simple cast chain (uint32)(int64)(var) that doesn't properly handle all var types. Switch to ApiHelpers::getColourFromVar which is the canonical colour conversion used throughout HISE and correctly handles int, int64, and string types.

Also add double handling to both ApiHelpers::getColourFromVar and scriptnode::PropertyHelpers::getColourFromVar so colour values that have been through JSON serialization (which converts large integers to doubles) are handled correctly.

https://claude.ai/code/session_01K4LR9ibEig4BHFCipQKYDQ

ValuePopup::Properties::getColour used ObjectWithDefaultProperties::getColourFrom
which does a simple cast chain (uint32)(int64)(var) that doesn't properly handle
all var types. Switch to ApiHelpers::getColourFromVar which is the canonical
colour conversion used throughout HISE and correctly handles int, int64, and
string types.

Also add double handling to both ApiHelpers::getColourFromVar and
scriptnode::PropertyHelpers::getColourFromVar so colour values that have been
through JSON serialization (which converts large integers to doubles) are
handled correctly.

https://claude.ai/code/session_01K4LR9ibEig4BHFCipQKYDQ
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.

2 participants