It might be helpful for others so I decided to share the piece of code I wrote tonight. I have a list of colors (Pantones) and I wanted to display a color preview in the data object tree. I followed this doc : https://pimcore.com/docs/6.x/Development_Documentation/Objects/Object_Classes/Class_Settings/Custom_Icons.html
Heres the in my AdminStyle-extended class :
The other reason I wanted to share this with you is that I struggled on a weird issue. I used the hex value in the filename but I hadn’t noticed that it was appending a hash sign (#)… Problem was the hash has a very specific meaning in the URL format as you probably already know. So I you can’t figure why your asset doesn’t load, double check you save a correctly formed URL!