You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue with lighten/darken (not tested other functions yet). If i pass a colorName or hex value, these all work as expected.
However if i pass the color of a control (which is set as an RGB value) or if i simply pass an RGB value, darken returns black and lighten returns a dark grey, no matter what color is passed as RBG.
The attached stack is a simple test - the buttons on the left assign aa color to 'source' by color name, RGB or hex, the buttons on the right lighten/darken the 'destination' graphic based on the 'source' background color. tinyColor test.livecode.zip
The text was updated successfully, but these errors were encountered:
Further to this, i realised the issue - the input is expected to be in the format RGB(r, g, b) instead of "r, g, b" - the latter is common usage in livecode and this therefore causes issues.
For example, passing darken("RGB(255,104,110)", 30) works as expected, but passing darken("255,104,110", 30) fails - the RBG values in sColor are all 0.
Could i therefore make a request to parse "r, g, b" as an RGB triplet without the qualifier 'RGB()', as is commonly the case in LiveCode?
A small addition to inputToRGB handler fixes this issue - in other words, statements like darken(the backgroundColor of graphic 1, 25) will now work as expected instead of returning 0,0,0.
I'm made a pull request with this working fix - it's my first pull request so apologies if it's not done correctly!
I'm having an issue with lighten/darken (not tested other functions yet). If i pass a colorName or hex value, these all work as expected.
However if i pass the color of a control (which is set as an RGB value) or if i simply pass an RGB value, darken returns black and lighten returns a dark grey, no matter what color is passed as RBG.
The attached stack is a simple test - the buttons on the left assign aa color to 'source' by color name, RGB or hex, the buttons on the right lighten/darken the 'destination' graphic based on the 'source' background color.
tinyColor test.livecode.zip
The text was updated successfully, but these errors were encountered: