![]() $colorArray1 = str_replace('%', '', $colorArray) # test if begins with cmyka and 5 numeric entries # test if begins with rgba, hsla, hsba, cmyk and 4 numeric entries # test if begins with rgb, hsl, hsb and 3 numeric entries # test if begins with gray and 1 numeric entry $color Contains A Numerical Alpha Component That Is Greater Than 1" Įlseif ( is_numeric($colorArray) & $colorArray > 1 & $chars5 = "cmyka" )Įlseif ( is_numeric($colorArray) & $colorArray > 1 & $chars5 = "graya" ) $color Contains A Numerical Non-Hue Component That Is Greater Than 255" Įlseif ( is_numeric($colorArray) & $colorArray > 1 & ( $chars4 = "rgba" || $chars4 = "hsla" || $chars4 = "hsba" ) ) $color Contains A Numerical Hue Component That Is Greater Than 360" Įlseif ( is_numeric($colorArray) & $i != 1 & $colorArray > 255 & ( $chars3 = "hsl" || $chars3 = "hsb" ) ) $color Contains A Numerical Color Component That Is Greater Than 255" Įlseif ( is_numeric($colorArray) & $colorArray > 360 & ( $chars3 = "hsl" || $chars3 = "hsb" ) ) ![]() $color Contains A Numerical Color Component That Is Greater Than 100%" Įlseif ( is_numeric($colorArray) & $colorArray > 255 & ( $chars3 = "rgb" || $chars4 = "cmyk" || $chars4 = "gray" ) ) # also test if rgba, hsla, hsba, cmyka and graya and last component > 1 # test for 1st, numerical values > 360 if starts with hsl or hsb # test for numerical values > 255 if starts with rgb, cmyk or gray $alphnumArray = preg_split('//', $color) Įlseif ( $hashcount = 1 & $hashloc != 0 )Įlseif ( $hashcount = 1 & $hashloc = 0 & $hexcount != 4 & $hexcount != 5 & $hexcount != 7 & $hexcount != 9 & $hexcount != 13 & $hexcount != 17 )Įlseif ( $hashcount = 0 & $lparenct != 1 & $rparencount != 1 ) # and non-hex with 1 set of parens and with numeric chars not at end # and 3, 4, 6, 8, 12 or 16 following numberic chars # test for only 1 hex char only at beginning # begin sequence of tests for valid colors
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |