Update RGBToHex.md

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-09-13 00:35:04 +03:00
committed by GitHub
parent 8b91be9e2f
commit 74832b19a7

View File

@ -3,7 +3,7 @@ title: RGBToHex
tags: string,math,intermediate tags: string,math,intermediate
--- ---
Converts the values of RGB components to a color code. Converts the values of RGB components to a hexadecimal color code.
Convert given RGB parameters to hexadecimal string using bitwise left-shift operator (`<<`) and `toString(16)`, then `String.padStart(6,'0')` to get a 6-digit hexadecimal value. Convert given RGB parameters to hexadecimal string using bitwise left-shift operator (`<<`) and `toString(16)`, then `String.padStart(6,'0')` to get a 6-digit hexadecimal value.