diff --git a/docs/index.html b/docs/index.html index b901fc395..e11294cd0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -23,7 +23,7 @@
-

 30 seconds of code

+

 30 seconds of code

@@ -934,12 +934,12 @@ Return the string truncated to the desired length, with ... appende

Converts a colorcode to a rgb() string.

Use bitwise right-shift operator and mask bits with & (and) operator to convert a hexadecimal color code (prefixed with #) to a string with the RGB values. In case it's a 3-digit-colorcode, do the same with the 6-digit-colorcode extended by the extendHex() function (ref. extendHex snippet)

const hexToRgb = hex => {
-  const extendHex = shortHex => 
+  const extendHex = shortHex =>
     '#' + shortHex.slice(shortHex.startsWith('#') ? 1 : 0).split('').map(x => x+x).join('');
-  return hex.slice(1).length==3 ? 
+  return hex.slice(1).length==3 ?
   `rgb(${parseInt(extendHex(hex).slice(1), 16) >> 16}, ${(parseInt(extendHex(hex).slice(1), 16) & 0x00ff00) >> 8}, ${parseInt(extendHex(hex).slice(1), 16) & 0x0000ff})`:
   `rgb(${parseInt(hex.slice(1), 16) >> 16}, ${(parseInt(hex.slice(1), 16) & 0x00ff00) >> 8}, ${parseInt(hex.slice(1), 16) & 0x0000ff})`;
-}   
+}
 // hexToRgb('#27ae60') -> 'rgb(39, 174, 96)'
 // hexToRgb('#acd') -> 'rgb(170, 204, 221)'
 
@@ -1042,8 +1042,7 @@ Use Number() to check if the coercion holds.


- + -