ioBroker.js-controller icon indicating copy to clipboard operation
ioBroker.js-controller copied to clipboard

Feature-Request: Predefined Alias read/write functions for color conversion

Open sbormann opened this issue 4 years ago • 4 comments

Would be great to be able to do sth like alias.read=hue2rgb(val) and alias.write=rgb2hue(val)

sbormann avatar Mar 29 '22 16:03 sbormann

Maybe some more functions might be interesting too?

Apollon77 avatar Mar 29 '22 19:03 Apollon77

Ideas:

  • clamp(min, max, value)
  • roundTo(value, numDigits)
  • other color conversions (HSL; white color temp like mired/kelvin)
  • ...

AlCalzone avatar Mar 29 '22 20:03 AlCalzone

  • hex2dec/dec2hex (BE and LE)

I think Math is available in general, so "roundTo" could be replaced, but yes convenient

Apollon77 avatar Mar 29 '22 20:03 Apollon77

Maybe allow to define such functions in a central object, then we could say controller (maybe) provides some really core methods and users or adapters can add additional methods.

foxriver76 avatar Mar 29 '22 20:03 foxriver76