Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-19 22:49:51 +03:00
parent 40a411f5b8
commit 920a0c390b
41 changed files with 94 additions and 81 deletions

View File

@ -3,7 +3,7 @@ title: hexToRGB
tags: string,math,advanced
---
Converts a color code to a `rgb()` or `rgba()` string if alpha value is provided.
Converts a color code to an `rgb()` or `rgba()` string if alpha value is provided.
- Use bitwise right-shift operator and mask bits with `&` (and) operator to convert a hexadecimal color code (with or without prefixed with `#`) to a string with the RGB values.
- If it's 3-digit color code, first convert to 6-digit version.