Yes! I actually worked out a solution to an almost identical problem earlier this year with another member who wanted to show/hide a visual based on whether or not it met the threshold for necessary sample size. You can do this in DAX by manipulating the value of the transparency mask. In your case, you’ll probably want to use an IF(ISFILTERED()) construct to determine whether there is a selection made in your slicer, and depending on the result add the two extra zeros to the hex code to turn it transparent.
Take a look at the following threads – I think they will give you everything you need to solve this one.