-----------------------GetFontList.asp----------------------
<%
function abchk(S)
dim SList
SList=Array(0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F")
abchk=SList(s)
end function
function GetRBGNum(X)
dim bx,i,k
bx=0
for i=0 to 15
for k=0 to 15
bx=bx+1
if UCase(X)=UCase(abchk(i)&abchk(k)) then
GetRBGNum=bx
end if
next
next
end function
function GetRBGTxet(Y)
dim bx,i,k
bx=0
for i=0 to 15
for k=0 to 15
bx=bx+1
if int(Y)=int(bx) then
GetRBGTxet=UCase(abchk(i)&abchk(k))
end if
next
next
end function
function GetRBGListA(T1,T2,T3)
dim TmpList,i
for i=1 to T3
TmpList=TmpList&GetRBGTxet(int(T1+T2*i))&","
next
GetRBGListA=TmpList
end function
function GetRBGListB(T1,T2,T3)
dim TmpList,i
for i=0 to int(T3-1)
TmpList=TmpList&GetRBGTxet(int(T1+T2*int(T3-i)))&","
next
GetRBGListB=TmpList
end function
function GetFontList(color1,color2,InMsgA)
dim num,Tbn,c
dim TheR,TheB,TheG
dim RGonum,BGonum,GGonum
dim ROnum,BOnum,GOnum
dim RList,BList,GList
num=len(InMsgA)-1
if int(GetRBGNum(mid(color1,2,2)))=>int(GetRBGNum(mid(color2,2,2))) then
TheR="A"
RGonum=int(int(GetRBGNum(mid(color1,2,2)))-int(GetRBGNum(mid(color2,2,2))))/int(num)
ROnum=int(GetRBGNum(mid(color2,2,2)))
else
TheR="B"
RGonum=int(int(GetRBGNum(mid(color2,2,2)))-int(GetRBGNum(mid(color1,2,2))))/int(num)
ROnum=int(GetRBGNum(mid(color1,2,2)))
end if
if int(GetRBGNum(mid(color1,4,2)))=>int(GetRBGNum(mid(color2,4,2))) then
TheB="A"
BGonum=int(int(GetRBGNum(mid(color1,4,2)))-int(GetRBGNum(mid(color2,4,2))))/int(num)
BOnum=int(GetRBGNum(mid(color2,4,2)))
else
TheB="B"
BGonum=int(int(GetRBGNum(mid(color2,4,2)))-int(GetRBGNum(mid(color1,4,2))))/int(num)
BOnum=int(GetRBGNum(mid(color1,4,2)))
end if
if int(GetRBGNum(mid(color1,6,2)))=>int(GetRBGNum(mid(color2,6,2))) then
TheG="A"
GGonum=int(int(GetRBGNum(mid(color1,6,2)))-int(GetRBGNum(mid(color2,6,2))))/int(num)
GOnum=int(GetRBGNum(mid(color2,6,2)))
else
TheG="B"
GGonum=int(int(GetRBGNum(mid(color2,6,2)))-int(GetRBGNum(mid(color1,6,2))))/int(num)
GOnum=int(GetRBGNum(mid(color1,6,2)))
end if
if TheR="A" then RList=GetRBGListA(ROnum,RGonum,num) else RList=GetRBGListB(ROnum,RGonum,num)
if TheB="A" then BList=GetRBGListA(BOnum,BGonum,num) else BList=GetRBGListB(BOnum,BGonum,num)
if TheG="A" then GList=GetRBGListA(GOnum,GGonum,num) else GList=GetRBGListB(GOnum,GGonum,num)
if TheR="A" then
Tbn=1
GetFontList="<B><font color="""&color2&""">"&mid(InMsgA,Tbn,1)&"</font>"
Else
GetFontList="<B>"
Tbn=0
End if
for c=0 to int(num-1)
Tbn=Tbn+1
GetFontList=GetFontList&"<font color=""#"&Split(RList,",")(c)&Split(BList,",")(c)&Split(GList,",")(c)&""">"&mid(InMsgA,Tbn,1)&"</font>"
next
if TheR="B" then
GetFontList=GetFontList&"<font color="""&color1&""">"&mid(InMsgA,Tbn+1,1)&"</font>"
End if
GetFontList=GetFontList&"</B>"
end function
%>
调用格式
<%=GetFontList("#FF0000","#FFFFFF","ASP生成过渡色")%>