更多>
最新下载
24小时阅读排行榜
- 1 css文字过长导致布局变形怎么办_text-overflow与ellipsis实现省略号
- 2 如何配置Golang网络编程环境_Golang网络开发配置说明
- 3 C++中的虚函数(virtual function)是如何工作的?(动态多态)
- 4 css中类选择器的注意事项
- 5 Avalonia如何自定义DataGrid的行样式 Avalonia DataGrid RowStyle
- 6 Java如何从输入流(InputStream)解析XML
- 7 Java怎么把一个类的所有字段动态生成XML
- 8 Avalonia中的Grid布局怎么用 Avalonia Grid布局入门
- 9 网页嵌入php链接失败执行时间超时怎么办_网页嵌入php链接失败超时设置法【技巧】
- 10 Blazor 怎么做单元测试
- 11 C# typeof和GetType()的区别 - 编译时与运行时的类型信息
- 12 EF Core如何自定义迁移历史表 EF Core迁移历史表配置方法
- 13 c++的std::to_chars和std::from_chars怎么用 高性能的数字字符串转换【详解】
- 14 C#怎么合并两个XML文档
- 15 Blazor LocalStorage 和 SessionStorage 使用方法
更多>
最新教程
-
- Node.js 教程
- 14254 2025-08-28
-
- CSS3 教程
- 1541007 2025-08-27
-
- Rust 教程
- 21950 2025-08-27
-
- Vue 教程
- 24445 2025-08-22
-
- PostgreSQL 教程
- 21151 2025-08-21
-
- Git 教程
- 8334 2025-08-21
下载首页 / 类库下载 / 其它类库
<?php
function ColorDarken($color, $dif=20){
$color = str_replace('#', '', $color);
if (strlen($color) != 6){ return '000000'; }
$rgb = '';
for ($x=0;$x<3;$x++){
$c = hexdec(substr($color,(2*$x),2)) - $dif;
$c = ($c < 0) ? 0 : dechex($c);
$rgb .= (strlen($c) < 2) ? '0'.$c : $c;
}
return '#'.$rgb;
}
//范例:
for ($x=1; $x < 20; $x++){
// Start color:
$c = ColorDarken('#FF481D', ($x * 3));
print "<div style='background-color: $c; color: $c; font-size: 50%; padding: 0px;'>.</div>\n";
}
?>这是一个操作颜色变深的PHP类,需要的朋友可以下载使用。
本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn
