IO-1722 adjusted logic for card color
This commit is contained in:
@@ -7,10 +7,13 @@ const CardColorLegend = ({ bodyshop }) => {
|
||||
const data = bodyshop.ssbuckets.map((bucket) => {
|
||||
let color = { r: 255, g: 255, b: 255 };
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
color = bucket.color.rgb;
|
||||
if (bucket.color) {
|
||||
color = bucket.color;
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
color = bucket.color.rgb;
|
||||
}
|
||||
}
|
||||
color = bucket.color; // default to white
|
||||
|
||||
return {
|
||||
label: bucket.label,
|
||||
|
||||
@@ -24,11 +24,17 @@ const cardColor = (ssbuckets, totalHrs) => {
|
||||
bucket.gte <= totalHrs && (!!bucket.lt ? bucket.lt > totalHrs : true)
|
||||
)[0];
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
return bucket.color.rgb;
|
||||
let color = { r: 255, g: 255, b: 255 };
|
||||
|
||||
if (bucket && bucket.color) {
|
||||
color = bucket.color;
|
||||
|
||||
if (bucket.color.rgb) {
|
||||
color = bucket.color.rgb;
|
||||
}
|
||||
}
|
||||
|
||||
return bucket.color ?? { r: 255, g: 255, b: 255 }; // default to white
|
||||
return color;
|
||||
};
|
||||
|
||||
function getContrastYIQ(bgColor) {
|
||||
|
||||
Reference in New Issue
Block a user