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
…#2866)

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Nov 10, 2024
1 parent 7e8a03e commit 90210ae
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 90210ae

Please sign in to comment.