-
Notifications
You must be signed in to change notification settings - Fork 0
colorToCode
Corey Avis edited this page Sep 23, 2026
·
2 revisions
Part of the custom CoreyPHP color code utility system used to dynamically render and style generated files. Converts a human-readable color name back into its corresponding single-character CoreyPHP color code.
colorToCode(string $color): string
color (string)
: The full name of the color. This method is case-insensitive and automatically strips internal whitespace (e.g., both Sky Blue and skyblue map to the same color).
- See the internal mapping rules: CoreyPHP Color Code Utility System Documentation
(string)
: Returns the lowercase single-character representation of the color. Defaults to "w" (white) if the name is unrecognized.
$cphp->colorToCode('yellow') = y
- No debug errors.
codeToColor | codeToHex | codeToRgb
Home | CoreyPHP | Color Code