Custom printer help (hp lower, color change)

Well i am making a printer, i would ask if anyone could help me make my printer change colour when the printer got lower hp.
Like start red and go lighty.

I have been working all day with this, and got stuck.

if printer:HP() == 50 then

Obvs you’ll have to have a printer HP function

Okay!! ty man!