How can I convert alpha input to hex for computation?