diff --git a/translated/tech/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md b/published/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md similarity index 86% rename from translated/tech/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md rename to published/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md index 275db90ed2..75e8a5ef6f 100644 --- a/translated/tech/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md +++ b/published/20230406.0 ⭐️⭐️ Make a web-safe color guide with Bash.md @@ -3,22 +3,28 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15928-1.html" -使用 Bash 制作 Web 安全的颜色指南 +使用 Bash 制作 Web 安全颜色 ====== -当计算机显示器的调色板有限时,网页设计师通常使用一组 [Web 安全颜色][1]来创建网站。虽然在较新设备上显示的现代网站可以显示比最初的 Web 安全调色板更多的颜色,但我有时喜欢在创建网页时参考 Web 安全颜色。这样我就知道我的网页在任何地方都看起来不错。 +![][0] + +> 使用 Bash 中的 for 循环,为网页创建一个方便的调色板。 + +当计算机显示器的调色板有限时,网页设计师通常使用一组 [Web 安全颜色][1] 来创建网站。虽然在较新设备上显示的现代网站可以显示比最初的 Web 安全调色板更多的颜色,但我有时喜欢在创建网页时参考 Web 安全颜色。这样我就知道我的网页在任何地方都看起来不错。 你可以在网上找到 Web 安全调色板,但我想拥有自己的副本以方便参考。你也可以使用 Bash 中的 `for` 循环创建一个。 ### Bash for 循环 -[Bash 中的 for 循环][2]的语法如下所示: +[Bash 中的 for 循环][2] 的语法如下所示: -> for _variable_ in _set_ ; do _statements_ ; done +``` +for 变量 in 集合 ; do 语句 ; done +``` 例如,假设你想打印从 1 到 3 的所有数字。你可以快速在 Bash 命令行上编写一个 `for` 循环来为你完成这项工作: @@ -198,6 +204,8 @@ $ bash websafe.bash > websafe.html ![Web colors.][4] +*(题图:MJ/abf9daf2-b72f-4929-8dd8-b77fb5b9d39b)* + -------------------------------------------------------------------------------- via: https://opensource.com/article/23/4/web-safe-color-guide-bash @@ -205,7 +213,7 @@ via: https://opensource.com/article/23/4/web-safe-color-guide-bash 作者:[Jim Hall][a] 选题:[lkxed][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -214,4 +222,5 @@ via: https://opensource.com/article/23/4/web-safe-color-guide-bash [1]: https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors [2]: https://opensource.com/article/19/6/how-write-loop-bash [3]: https://opensource.com/sites/default/files/2023-03/10000001000002620000013685924861376B1AB6.webp -[4]: https://opensource.com/sites/default/files/2023-03/10000001000002620000013633233DC8DC56C891.webp \ No newline at end of file +[4]: https://opensource.com/sites/default/files/2023-03/10000001000002620000013633233DC8DC56C891.webp +[0]: https://img.linux.net.cn/data/attachment/album/202306/21/133552hlgt2vdditxfzzcl.jpg \ No newline at end of file