[FIX] web: fix wrong convertion of 8-digit hex to RGBA color

closes odoo/odoo#40991

X-original-commit: fdfce09ea5312d42379c58b334ea0ed22b8ddbfa
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2019-11-27 13:59:33 +00:00
parent cfbeed761a
commit 8686ef0fb6
@@ -421,7 +421,7 @@ ColorpickerDialog.convertHexToRgba = function (hex) {
red: parseInt(hex.substr(1, 2), 16),
green: parseInt(hex.substr(3, 2), 16),
blue: parseInt(hex.substr(5, 2), 16),
opacity: hex.length === 9 ? parseInt(hex.substr(7, 2), 16) : 100,
opacity: (hex.length === 9 ? (parseInt(hex.substr(7, 2), 16) / 255) : 1) * 100,
};
};
/**