Skip to content

Commit

Permalink
UPDATE: svg color filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mabasian committed Oct 15, 2024
1 parent bed55d9 commit d400cde
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
class="w-3/4"
src="/img/icon/control-page-icons/cpuIcon.svg"
:style="{
filter:
controlStore.tempCPU === null
? ''
: `brightness(0) saturate(100%) sepia(1) hue-rotate(${
tempCPU.value === 'green' ? '120deg' : tempCPU.value === 'orange' ? '40deg' : '0deg'
})`,
fill: controlStore.tempCPU === null || controlStore.tempCPU === undefined || controlStore.tempCPU === '' ? '' : tempCPU,
}"
/>
</div>
Expand Down Expand Up @@ -89,7 +84,7 @@ const chartOptions = {
const tempCPU = computed(() => {
if (controlStore.tempCPU == null || controlStore.tempCPU === undefined) return "";
if (controlStore.tempCPU > 40) return "red";
if (controlStore.tempCPU > 30) return "yellow";
if (controlStore.tempCPU > 30) return "orange";
if (controlStore.tempCPU <= 30) return "green";
return "";
});
Expand Down

0 comments on commit d400cde

Please sign in to comment.