惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - Koy

vbox 安装 MacOS 时遇到的问题 转载:登录后,用户配置被修改的处理方法 left join 和 inner join 区别和优化 動態修改 XML 欄位 (轉載)sql server xml字段的操作 (轉)CSS 单行溢出文本显示省略号...的方法(兼容IE FF) (轉)Equal height boxes with CSS 獲得瀏覽器顯示標簽的真實的長寬高 轉:Jquery绑定img的click事件 SqlLocalDB 的一些常用命令行 转:css实现强制不换行/自动换行/强制换行 終于解決调用wordpress 4.3 xmlrpc api 发布包含分类的文章时返回“抱歉,文章类型不支持您的分类法”错误的問題 SQL 數字欄位格式調整(輸出結果以0補至固定長度) 转载:数组Marshalling ajax 維護 div 的 scrollbar 每日构建的好工具 修正了Flex Tree 控件在動態加載節點后 Scrollbar 沒有立即出現的問題 根據基本目錄及文件的全路逕,創建相應的子目錄,爲保存文件作準備 - Koy - 博客园 轉載:Sqlserver 2005 利用 with 創建臨時表進行遞歸查詢
认识位移操作符
Koy · 2018-11-22 · via 博客园 - Koy

认识位移操作符

2018-11-22 12:57  Koy  阅读(761)  评论()    收藏  举报

当年书没好好读,在做这行十几年之后的今天才有所了解这个位移操作。觉得很有意思所摘录下来,当笔记用。

参考网址如下:

http://www.w3school.com.cn/js/pro_js_operators_bitwise.asp

https://whis.wang/index.php/javascript/an-operator-use-in-js.html

摘录内容:

4.使用&, >>, |来完成rgb值和16进制颜色值之间的转换

/**
 * 16进制颜色值转RGB
 * @param  {String} hex 16进制颜色字符串
 * @return {String}     RGB颜色字符串
 */
  function hexToRGB(hex) {
    var hexx = hex.replace('#', '0x')
    var r = hexx >> 16
    var g = hexx >> 8 & 0xff
    var b = hexx & 0xff
    return `rgb(${r}, ${g}, ${b})`
}