<cffunction name="randColor">
<cfset var color1 = InputBaseN("000000",16)>
<cfset var color2 = InputBaseN("FFFFFF",16)>
<cfif( StructKeyExists(ARGUMENTS,"1") )>
<cfset color1 = InputBaseN(ARGUMENTS['1'],16)>
</cfif>
<cfif( StructKeyExists(ARGUMENTS,"2") )>
<cfset color2 = InputBaseN(ARGUMENTS['2'],16)>
</cfif>
<cfif(color1 gt color2)>
<cfreturn FormatBaseN(randrange(color2,color1),16)>
</cfif>
<cfreturn FormatBaseN(randrange(color1,color2),16)>
</cffunction>
<div
style=" width:80px;
height:80px;
background-color: #<cfoutput>#randColor("FFFFFF","CCCCCC")#</cfoutput>;" />
Nenhum comentário:
Postar um comentário