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

Support HEX-Formatted RGB Values for color #821

Closed
nihebe opened this issue Nov 30, 2017 · 4 comments
Closed

Support HEX-Formatted RGB Values for color #821

nihebe opened this issue Nov 30, 2017 · 4 comments
Assignees
Milestone

Comments

@nihebe
Copy link

nihebe commented Nov 30, 2017

Hey guys,

is there someone around who can give me a hint regarding the color-feature? I'm using a FHEM-server behind my ha-bridge, which controls my Milights. That server expects HEX encoded values for RGB.

Are there any chances to not only have
${color.r} ${color.g} ${color.b} (0-255 format)
but also
${color.rgb} (HEX format)?

I'm looking forward your answers.

Best
Nils

@peos3
Copy link

peos3 commented Nov 30, 2017

I dont' know your exact setup, but can't you just calculate the Hex Value, given the RGB values?

Best regards,
Pascal

@bwssytems
Copy link
Owner

@nihebe Could you give an example on how that format would be described?

@nihebe
Copy link
Author

nihebe commented Dec 4, 2017

@peos3 Well you're right, using a bash-script which calculates the HEX representation and executes the Rest-Call would be a solution, but quite unpleasant to maintain.

@bwssytems Of course! Here you go: RGB: 66, 134, 244 (light blue) would be HEX: 4286f4
I think this could be easily mapped by something like String.format("%02x%02x%02x", r, g, b);

@bwssytems bwssytems self-assigned this Dec 4, 2017
@bwssytems bwssytems added this to the V5.1.0 milestone Dec 11, 2017
@bwssytems
Copy link
Owner

Added ${color.rx} ${color.gx} ${color.bx} ${color.rgbx}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants