css hex to rgb

Solutions on MaxInterview for css hex to rgb by the best coders in the world

showing results for - "css hex to rgb"
Isabella
15 Feb 2016
1hexToRGB(hex, alpha) {
2
3  const r = parseInt(hex.slice(1, 3), 16);
4  const g = parseInt(hex.slice(3, 5), 16);
5  const b = parseInt(hex.slice(5, 7), 16);
6
7  if (alpha) {
8    return `rgba(${r}, ${g}, ${b}, ${alpha})`;
9  } else {
10    return `rgb(${r}, ${g}, ${b})`;
11  }
12}
13
Salvatore
17 Apr 2018
1hexToRGB(hex, alpha) {
2
3  const r = parseInt(hex.slice(1, 3), 16);
4  const g = parseInt(hex.slice(3, 5), 16);
5  const b = parseInt(hex.slice(5, 7), 16);
6
7  if (alpha) {
8    return `rgba(${r}, ${g}, ${b}, ${alpha})`;
9  } else {
10    return `rgb(${r}, ${g}, ${b})`;
11  }
12}
queries leading to this page
from hex to rgbhex color codes to rgbhex color to rgb0convert hexa to rgb csshex code to rgbturn hex into rgbhexadecimaal to rgbhex to rgb cssconvert hex into rgb0073aa hex to rgbhow to convert hex to rgbhex code to rgb hex converterhexa to rgb cssconvert hex colour to rgbhex into rgbconvert hex color code to rgbhex to rgb codeconvert hex to rgbhex colur to rgbconvert hex codes to rgbconver hex to rgbhexadecimal to rgbhex to rgbgconvert hex to rgb in csshex to rgxhex to rgb csshex colour to rgbfrom hex in rgbcss variable hex to rgbhex to rgb colorhex to rbgcolor code hex to rgbhex to rgb color converterhex value to rgbhex to rgb color codechange hex color to rgbconverter from hex to rgbchange color hex to rgbhex code color to rgbcovert hex to rgbhow to convert color hex to rgbhex to rbconvert hex to rgb by csshow to convert a rgb color to a hexcss hex to rgb hex code to rgb colorconvert hexa color to rgbhex to rghow to make rgb from hexcobver hex to rgbhex to rgb conversioncolorrrs hex to rgbhexadecimal color to rgbhow to convert hex code to rgbhex to rgb converterconvert hex code to rgbhex to rgbhex in rgbhow to convert from hex to rgbhexcode to rgbconvert hex to rgb cssconvert hexa tto rgb csshow to convert a hex to rgb in csshow to convert hex color to rgbhex to rgb 27hex string to rgbcolor code converter hex to rgbhex color to rgbget hex to rgbhexs to rgbcolor convert hex to rgbhex to rbg colorsheximal to rgbcss color hex to rgb ahex to rgbcss convert hex to rgbcolors in hex rgbhex colors to rgbcolors hex to rgbconvert hexadecimal color to rgbhex 23 to rgbconvert hex color to rgbcolor converter hex to rgbhex to rgb how to converthex to rgpconvert color hex to rgbhex to rgb hexcss rgb to hexhexcode color to rgb232f3e hex to rgbcolor hex on rgbturn hex code into rgbcss convert rgb to hexconvert hex to rgb color codechange hex to rgbcolor hex to rgbconverter hex to rgbcss hex to rgb