const extendHex = (shortHex: string) =>
        '#' +
        shortHex
          .slice(shortHex.startsWith('#') ? 1 : 0)
          .split('')
          .map(x => x + x)
          .join('');
      

      Typescript language logo
      Extend hex color

      Codiga's TypeScript Recipes

      Extends a 3-digit color code to a 6-digit color code.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.