ASP生成过渡色的子程序!

-----------------------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生成过渡色")%>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值