当前位置:网站首页>13 essential methods of color!
13 essential methods of color!
2022-07-24 18:12:00 【Solution without encirclement】
Color 13 Necessary methods !
Randomly generate hexadecimal colors
// Randomly generate hexadecimal colors
const randomHexColorCode = () => {
let n = (Math.random() * 0xfffff * 1000000).toString(16);
return "#" + n.slice(0, 6);
};
// Use
randomHexColorCode(); // '#e34155'
RGB To hexadecimal
//RGB To hexadecimal
const RGBToHex = (r, g, b) =>
((r << 16) + (g << 8) + b).toString(16).padStart(6, "0");
// Use
RGBToHex(255, 165, 1); // '#ffa501'
take 3 The bit color is extended to 6 Bit color
// take Hexadecimal 3 The bit color is extended to 6 Bit color
const extendHex = (shortHex) =>
"#" +
shortHex
.slice(shortHex.startsWith("#") ? 1 : 0)
.split("")
.map((x) => x + x)
.join("");
// Use
extendHex("#03f"); // '#0033ff'
extendHex("05a"); // '#0055aa'
take rgb() The color string is converted to an object with each color value .
// take rgb() The color string is converted to a 边栏推荐
- (mandatory) override equals must override hashcode (principle analysis)
- undefined reference to H5PTopen
- Install jumpserver
- Three ways of redis cluster
- The drop-down list component uses iscrol JS to achieve the rolling effect of the pit encountered
- web渗透经验汇总ing
- 6126. 设计食物评分系统
- Use prometheus+grafana to monitor MySQL performance indicators
- Laravel notes - RSA encryption of user login password (improve system security)
- Mozilla foundation released 2022 Internet health report: AI will contribute 15.7 trillion yuan to the global economy in 2030, and the investment in AI in the United States last year was nearly three t
猜你喜欢

web渗透经验汇总ing

【OpenCV】—阈值化

Mozilla foundation released 2022 Internet health report: AI will contribute 15.7 trillion yuan to the global economy in 2030, and the investment in AI in the United States last year was nearly three t

Bib | mol2context vec: context aware deep network model learning molecular representation for drug discovery

Stream, file, IO

Go language file operation

下拉列表组件使用 iScroll.js 实现滚动效果遇到的坑

Laravel笔记-用户登录时密码进行RSA加密(提高系统安全性)

redis集群的三种方式

The drop-down list component uses iscrol JS to achieve the rolling effect of the pit encountered
随机推荐
Learn redisson from scratch ------- topics (subscription and distribution)
Introduction and use of Pinia
还在用命令行看日志?快用Kibana吧,可视化日志分析YYDS!
Still building projects from scratch? This upgraded rapid development scaffold is worth a try!
0614~ holiday self study
pinia 入门及使用
0625~<config>-<bus>
PXE高效批量网络装机
New can also create objects. Why do you need factory mode?
mac数据库管理软件Navicat Premium Essentials Mac
Model saving and loading of sklearn
Go language file operation
sklearn 的模型保存与加载使用
Awk from getting started to getting into the ground (19) awk extensions make awk even stronger
After separation, the impression notes are still difficult to live, but there are many coquettish operations
0612~quartz定时器框架
使用Prometheus+Grafana监控MySQL性能指标
船新 IDEA 2022.2 正式发布,新特性真香!
还在从零开始搭建项目?这款升级版快速开发脚手架值得一试!
What are the pitfalls from single architecture to distributed architecture?