hex2rgb

convert a hex color to RGB & ANSI Foreground & background

Takes a 6 character hexidecimal (hex) color and converts it to RGB. It then outputs the color in CSS and ANSI escape code styles.

Usage

USAGE: hex2rgb <hex color>
        Takes in a hex color and ouputs:

        - RGB (css style)
        - ANSI escape code for foreground color
        - ANSI escape code for background color

        The color can be in #CCFFCC or CCFFCC style.
        Does not support 3 character style (#CFC).
        Capitalization doesn't matter.

Metadata:

Tags:

  • ansi
  • cli
  • color