Skip to content

codeToHex

Corey Avis edited this page Sep 23, 2026 · 2 revisions

codeToHex

Part of the custom CoreyPHP color code utility system used to dynamically render and style generated files. Converts a single CoreyPHP color code character into a 6-digit hex color string, prefixed with #.

Usage

codeToHex(string|int $colorCode): string

Parameters

colorCode (string|integer) : A case-insensitive single character (a-z, 0-9).

Color Code

Return Value

(string) : Returns a lowercase, 7-character CSS-compatible hex value (e.g., "#ffff00").

Examples

$cphp->codeToHex('y') = #ffff00 (yellow)

Debug Errors

  • No debug errors.

Related Methods

codeToColor | codeToRgb | colorToCode


Home | CoreyPHP | Color Code

Clone this wiki locally