This app lets you convert colors using action cards. The conversion result is yielded by a trigger card, providing the conversion results as tokens in your flow.
The convertion action and trigger cards are linked by a free text event name.
Action Cards
Convert Kelvin
Converts a kelvin value into color data.
Arguements
‘Color Parsed Event Name’ The name of the event for the corresponding trigger card as text.
‘Kelvin Input’ The input kelvin value as string. Supports 1000-60000°K.
Execution of this card will fail if the color input value could not be parsed.
Convert Color
Converts a color given as string value.
Arguements
‘Color Parsed Event Name’ The name of the event for the corresponding trigger card as text.
‘Color Input’ The input color value as string. This field basically takes any values the tinycolor2 library is able to parse. Here are some examples:
Execution of this card will fail if the color input value could not be parsed.
Trigger Cards
Color Parsed
Delivers the conversion results requested by the corresponding action card with the same event name.
Arguements
‘Color Parsed Event Name’ The name of the event for the corresponding action card as text.
Tokens
‘Parsed Color HEX’ Hex value of the color as string. Example: #ff0000
‘Parsed Color Hue (%)’ The hue as percentage. (Value range: 0.0 - 1.0)
‘Parsed Color Saturation (%)’ The saturation as percentage. (Value range: 0.0 - 1.0)
‘Parsed Color Brightness (%)’ The brightness as percentage. (Value range: 0.0 - 1.0)
‘Parsed Color Hue (0-360)’ The hue as numeric value. (Value range: 0 - 360)
‘Parsed Color Saturation (0-100)’ The saturation numeric value. (Value range: 0 - 100)
‘Parsed Color Brightness (0-100)’ The brightness numeric value. (Value range: 0 - 100)
‘Parsed Color Red (0-255)’ Red component as numeric value. (Value range: 0 - 255)
‘Parsed Color Green (0-255)’ Green component as numeric value. (Value range: 0 - 255)
‘Parsed Color Blue (0-255)’ Blue component as numeric value. (Value range: 0 - 255)
‘Parsed Color Kelvin’ The estimated kelvin value for the color. (Value range: 1000 - 40000)
‘Parsed Color Is Bright’ Whether we have a light color as boolean.
‘Parsed Color Is Dark’ Whether we have a dark color as boolean.
‘Parsed Color Name’ The human readable name of the color as string if available.
Please note that this will spit out a localized string saying “Unknown” if the color could not be named.
This has the potential to be one of those essential apps. Is it possible that you share some screenshots for how it can/should be implemented in a flow? Personally, I’d like to convert the kelvin value of “Zonnestanden” to decide on the color of an RGB lamp. But I’ve ran into multiple situations in which one App provides me with an 0-255 R/G/B value and a device that requires a 0-100 Hue/Saturation value for example. An app like Color Tools could really open up new possibilities!
I will add examples as soon as I get around to it. Please bear in mind that this is the very first version and might as well also have some bugs left which slipped my attention.
Hey @Woltie_r & @martijn86,
sorry for the long wait. I added a simple example above.
If it does not work for your devices, then you most likely are subject to the lots of decimals issue in v1.0.1.
You can try the upcoming v1.0.2 from the test channel, which will address this problem.
I appreciate the response, I build the flows right but it seems that it doesn’t read the input Kelvin value properly. Do I need to clarify that it is a Kelvin value?
Kelvin actually is not supported as input value for the conversion lib used.
But I added a new action flow card for parsing kelvin values as input in v1.1.0. (already on test channel and waiting for release by Athom)
I think that is what you will need for the flow you sent me.
HI @Woltie_r,
no worries. v1.1.0 has already been approved an published. You should have gotton the update already.
Just replace the convert color action card with the convert kelvin action card. The trigger card is the same for both. Feed the convert kelvin action with your kelvin tag and you should be all good.
Hi there,
well, I don’t own any hue to test this. But in general it depends on how the target device works.
If it takes the kelvin value directly then this should work just fine by only sending the kelvin value to the device. If you have only the percentage based kelvin setting available for the device then the kelvin value will not do the trick. In that case you should use the hue, saturation and possibly the dim value and set those for the device. It will basically “emulate” the white temperatur using color mode.
Hope this is helpful to you.
Hello @Shakesbeard , thank you for this nice tool.
I stumbled upon this tool in search for a way to use the circadian lighting app for lights that don’t support Color temperature capability.
Any change you can update the action card’s for advanced flows’s? So the converted values can be used right away in the flow as output of the card, in stead of triggering through an event?
I might not be all up to date on everything, but I think this unfortunately is not supported by Homey. At least I am not aware of any method to create tag values, for the current flow, from within the action card code.
If anyone has any ideas on this, let me know please.
So far I am only aware of these approaches but they all have major downsides:
Register global variables to store results → This will lead to confusion as it would be just one global variable per purpose and it will be used by all the Color Tools flows. So there is a concurrency issue.
Update a Logic Variable → This will require extensive permissions which might give off a fishy look of the app. Like in “Wut? Color Tool wants to control my Homey?”. Also might have other side effects regarding concurrency.