Update common_services.js #444
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The rgba2hex function was not returning a valid hexadecimal value, the length must always be 8 characters (#RRGGBBWW). There is a condition that allows to send 4 characters instead of 8 but it is better not to shorten the value to facilitate the work in the program of the Arduino sketch.
Incorrect output:
58097 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3d25a209
58531 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819be0
60297 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=8,sg=0:#3819bec
61145 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=6,sg=0:#fd16c
61790 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=5,sg=0:#334c
Correct output:
589207 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#07112400
589512 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#181e2900
590118 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#182b5200
590553 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#0e3f9e00
591108 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e00
591978 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#229e0e2b
592775 TSF:MSG:READ,0-0-5,s=0,c=1,t=41,pt=0,l=9,sg=0:#00080900
PS: The RGB picker works fine, only the RGBW picker failed.