Skip to content
Snippets Groups Projects
Commit edfa8681 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

#187 - Use global design if no pad design exists

parent cd88eceb
No related branches found
No related tags found
No related merge requests found
......@@ -34,14 +34,16 @@ module.exports = async function (self) {
if (pad != null) {
self.log('debug', `Update feedback for pad id ${pad.id} with status ${pad.status}`);
if (pad.status === 'PLAY') {
let design = pad.design.play ?? self.currentProject.getDesign().play;
return {
bgcolor: hexStringToNumber(pad.design.play.hi),
color: hexStringToNumber(pad.design.play.font)
bgcolor: hexStringToNumber(design.hi),
color: hexStringToNumber(design.font)
};
} else {
let design = pad.design.normal ?? self.currentProject.getDesign().normal;
return {
bgcolor: hexStringToNumber(pad.design.normal.hi),
color: hexStringToNumber(pad.design.normal.font)
bgcolor: hexStringToNumber(design.hi),
color: hexStringToNumber(design.font)
};
}
} else {
......
......@@ -107,4 +107,12 @@ module.exports = class Project {
}
return null
}
/*
Design
*/
getDesign() {
return this.data.design;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment