Skip to main content
Module

x/isx/mod.ts>isHexColorFormat

TypeScript-first is function collections
Go to Latest
function isHexColorFormat
import { isHexColorFormat } from "https://deno.land/x/isx@1.0.0-beta.22/mod.ts";

Whether the value is Hex color or not.

Parameters

value: string
  • Any string.
import { isHexColorFormat } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isHexColorFormat("#000000"), true)
assertEquals(isHexColorFormat("#FFF"), true)
assertEquals(isHexColorFormat("#ggg"), false)

Returns

boolean