Skip to content

codeToRgb

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

codeToRgb

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 an indexed array containing Red, Green, and Blue channels.

Usage

codeToRgb(string|int $colorCode): array

Parameters

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

Color Code

Return Value

(array) : Returns a 3-element array matching [red, green, blue] where each element is an integer between 0 and 255. Defaults to [255, 255, 255] (white) if unrecognized.

Examples

$cphp->codeToRgb('y') = [255, 255, 0] (yellow)

Debug Errors

  • No debug errors.

Related Methods

codeToColor | codeToHex | colorToCode


Home | CoreyPHP | Color Code

Clone this wiki locally