JSFiddle - React, Tailwind, and code Playground

JavaScript

var hexValue = "aaaaaa";
hexValue = "0x" + hexValue;
hexValue = parseInt(hexValue , 16); //convert the string to a (decimal) number
hexValue = hexValue + 0x010101; //add to a hex value
hexValue = hexValue.toString(16); //convert decimal back to hex

document.writeln(hexValue); // outputs 'ababab'