code: function convertColorComponent (input) {
    let result = input.toString(16);
    if (result.length < 2) {
      result = '0' + result
    }
    return result;
  }
docs: converts number in base 10 to base 16, adds padding zero if needed