Skip to content
Pieter Hordijk edited this page Dec 30, 2018 · 1 revision

TOC

Hexadecimal

Validates the input (string) to be a hexadecimal color.

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\Color\Hexadecimal;

(new Hexadecimal())->validate('#ff3300');

Failure reasons

  • Type.String when the validated value is not a string
  • Color.Hexadecimal when the validated value is not a valid hexadecimal color

Clone this wiki locally