第九百零七章 你要是相信我,就跟我走 (第7/9頁)
天青煙雨提示您:看後求收藏(奇妙書庫www.qmshu.tw),接著再看更方便。
'color',
'outlinecolor'],
function
(i,
attr)
{
jquery.fx.step[attr]
=
function
(fx)
{
if
(fx.state
==
0)
{
fx.start
=
getcolor(fx.elem,
attr);
fx.end
=
getrgb(fx.end);
}
fx.elem.style[attr]
=
"rgb("
+
[
math.max(math.min(parseint((fx.pos
*
(fx.end[0]
-
fx.start[0]))
+
fx.start[0]),
255),
0),
math.max(math.min(parseint((fx.pos
*
(fx.end[1]
-
fx.start[1]))
+
fx.start[1]),
255),
0),
math.max(math.min(parseint((fx.pos
*
(fx.end[2]
-
fx.start[2]))
+
fx.start[2]),
255),
0)
].join(",")
+
")";
}
});
function
getrgb(color)
{
var
result;
if
(color
if
(result
=
/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return
[parseint(result[1]),
parseint(result[2]),
parseint(result[3])];
if
(result
=
/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return
[parsefloat(result[1])
*
2.55,
parsefloat(result[2])
*
2.55,
parsefloat(result[3])
*
2.55];
if
(result
=
/#([a-fa-f0-9]{2})([a-fa-f0-9]{2})([a-fa-f0-9]{2})/.exec(color))
return
[parseint(result[1],
16),
parseint(result[2],
16),
parseint(result[3],
16)];