Get a padded color value in hex format (00 - FF) from an int (0-255)
Paramètres
int $color: The color value.
Return value
string The color value in hex format.
1 call to ColorRGB::intToColorHex()
- ColorRGB::toHex dans src/
ColorRGB.php - Get the color as a hex instance.
Fichier
-
src/
ColorRGB.php, line 170
Classe
- ColorRGB
- RGB represents the RGB color format.
Namespace
Drupal\color_fieldCode
protected function intToColorHex(int $color) : string {
return str_pad(dechex($color), 2, '0', STR_PAD_LEFT);
}