scales func to make it fit svg and fill color