import e from"../../../../../_virtual/index19.mjs";import{declarationValueIndex as t}from"../../utils/nodeFieldIndices.mjs";import r from"../../utils/getDeclarationValue.mjs";import s from"../../utils/isUrlFunction.mjs";import o from"../../utils/report.mjs";import l from"../../utils/ruleMessages.mjs";import i from"../../utils/validateOptions.mjs";const u="color-no-hex",m=l(u,{rejected:e=>`Unexpected hex color "${e}"`}),a=/^#[\da-z]+$/i,n=/#[\da-z]+/i,d=l=>(d,c)=>{i(c,u,{actual:l})&&d.walkDecls(l=>{if(!n.test(l.value))return;e(r(l)).walk(e=>{if(s(e))return!1;if(!function({type:e,value:t}){return"word"===e&&a.test(t)}(e))return;const r=t(l)+e.sourceIndex,i=r+e.value.length;o({message:m.rejected,messageArgs:[e.value],node:l,index:r,endIndex:i,result:c,ruleName:u})})})};d.ruleName=u,d.messages=m,d.meta={url:"https://stylelint.io/user-guide/rules/color-no-hex"};export{d as default};