Skip to content

Commit

Permalink
Fix hsbToRgb util & Fix conversion in oh-canvas-embedded-svg-mixin.js
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <dev@florianhotze.com>
  • Loading branch information
florian-h05 committed Nov 10, 2024
1 parent 180cd78 commit 3f1abbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default {
console.info(`invalid rgb values in configured color: ${color}`)
return '#FF0000' // not valid returns red
}
const rgb = this.$oh.utils.hsbToRgb(rgbNumbers[0], rgbNumbers[1], rgbNumbers[2])
const rgb = this.$oh.utils.hsbToRgb(rgbNumbers[0], rgbNumbers[1] / 100, rgbNumbers[2] / 100)
return `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`
}
} else {
Expand Down
5 changes: 3 additions & 2 deletions bundles/org.openhab.ui/web/src/js/openhab/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Framework7 from 'framework7'
import diacritic from 'diacritic'

export default {
Expand All @@ -13,7 +14,7 @@ export default {
* @returns {number[]} [r, g, b] array
*/
hsbToRgb (h, s, b) {
const hsl = this.$f7.utils.colorHsbToHsl(h, s, b)
return this.$f7.utils.colorHslToRgb(hsl[0], hsl[1], hsl[2])
const hsl = Framework7.utils.colorHsbToHsl(h, s, b)
return Framework7.utils.colorHslToRgb(hsl[0], hsl[1], hsl[2])
}
}

0 comments on commit 3f1abbf

Please sign in to comment.