update component color when text is changed