<!DOCTYPE html> <html> <head> <title>tinycolor.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> tinycolor.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> <p>TinyColor v1.4.1
https://github.com/bgrins/TinyColor
Brian Grinstead, MIT License</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nb">Math</span><span class="p">)</span> <span class="p">{</span>
<span class="kd">var</span> <span class="nx">trimLeft</span> <span class="o">=</span> <span class="sr">/^\s+/</span><span class="p">,</span>
<span class="nx">trimRight</span> <span class="o">=</span> <span class="sr">/\s+$/</span><span class="p">,</span>
<span class="nx">tinyCounter</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
<span class="nx">mathRound</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">round</span><span class="p">,</span>
<span class="nx">mathMin</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">,</span>
<span class="nx">mathMax</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">,</span>
<span class="nx">mathRandom</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">random</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">tinycolor</span> <span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">)</span> <span class="p">{</span>
<span class="nx">color</span> <span class="o">=</span> <span class="p">(</span><span class="nx">color</span><span class="p">)</span> <span class="o">?</span> <span class="nx">color</span> <span class="o">:</span> <span class="s1">''</span><span class="p">;</span>
<span class="nx">opts</span> <span class="o">=</span> <span class="nx">opts</span> <span class="o">||</span> <span class="p">{</span> <span class="p">};</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p>If input is already a tinycolor, return itself</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="nx">color</span> <span class="k">instanceof</span> <span class="nx">tinycolor</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nx">color</span><span class="p">;</span>
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>If we are called as a function, call using new instead</p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">tinycolor</span><span class="p">))</span> <span class="p">{</span>
<span class="k">return</span> <span class="k">new</span> <span class="nx">tinycolor</span><span class="p">(</span><span class="nx">color</span><span class="p">,</span> <span class="nx">opts</span><span class="p">);</span>
<span class="p">}</span>
<span class="kd">var</span> <span class="nx">rgb</span> <span class="o">=</span> <span class="nx">inputToRGB</span><span class="p">(</span><span class="nx">color</span><span class="p">);</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_originalInput</span> <span class="o">=</span> <span class="nx">color</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">r</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">g</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_b</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">b</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_a</span> <span class="o">=</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">a</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_roundA</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="mi">100</span><span class="o">*</span><span class="k">this</span><span class="p">.</span><span class="nx">_a</span><span class="p">)</span> <span class="o">/</span> <span class="mi">100</span><span class="p">,</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_format</span> <span class="o">=</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">format</span> <span class="o">||</span> <span class="nx">rgb</span><span class="p">.</span><span class="nx">format</span><span class="p">;</span>
<span class="k">this</span><span class="p">.</span><span class="nx">_gradientType</span> <span class="o">=</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">gradientType</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p>Don't let the range of [0,255] come back in [0,1].
Potentially lose a little bit of precision here, but will fix issues where
.5 gets interpreted as half of the total, instead of half of 1
If it was supposed to be 128, this was already taken care of by <code>inputToRgb</code></p> </td> <td class="code"> <div class="highlight"><pre> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">_r</span> <span class="o">=</span> <span class="nx">mathRound</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_r</span><span class="p">);</span> <span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_g</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class=
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Ant Design of Vue 实现的 Ant Design Pro 源码
共39221个文件
js:21618个
ts:3588个
json:3351个
1星 需积分: 50 31 下载量 49 浏览量
2019-12-29
17:55:35
上传
评论 1
收藏 75.22MB RAR 举报
温馨提示
基于 Ant Design of Vue 实现的 Ant Design Pro 源码 安装依赖 npm install 开发模式运行 npm run serve 编译项目 npm run build
资源推荐
资源详情
资源评论
收起资源包目录
基于 Ant Design of Vue 实现的 Ant Design Pro 源码 (39221个子文件)
03bd6b9cc710cf5de32df24f6a6a0c6659b547318de6b9a77f76a04d648afc8e21b7b29b4dc65fe9fa6099e2b48f56ea666d8b5777fc701e58014675516e 5KB
045edbf88a4a4504a7290ea167ce36453af1020dbe5c51bc3df54629fec5 1KB
0954d7baf34aac451ddbc486df7bd9ec5d80dcca421b176bd3e9b54de0f6 1KB
0f93e84037b82cbeda89ce14efe1c583a437ba1058af88cf900999a09b98a522ef524ea8d05957d368c09a56a773dea86d6fe13bae64081dcc07ecc55239 4KB
sshpk-conv.1 4KB
he.1 3KB
jsesc.1 3KB
jsesc.1 3KB
jsesc.1 3KB
sshpk-sign.1 2KB
sshpk-verify.1 2KB
cssesc.1 2KB
cssesc.1 2KB
cssesc.1 2KB
1410496404e043f832cbc8b71a675aeaac9a1585df67388245ee4a7cdb3c 1KB
15291514aab940be911ed92090165f2da363f32e2a93fe2f66f2014f04930f145b721a0e96711a47401ee58d8389e4952f2fd19bddd932e5c03024dc4715 5KB
18101346228fabd2a0dc97fc4cfd97e3df0bed833ad47999552323ca5812 1KB
1a14983f0d610804a190295fb157284001263a0cacb5b93b4302bfda4b0bfce7eb67ab98e6a5f16bfb0cf964d7b406f83e099efa62ae73665e4341003e4d 9KB
2095a9d45cfa102a6582c4f9f6b10b4f7daf0f27890336b5ddc3fc6a887513726bf518952854811e41ea71dfaa5a6e695ab54be86a8e91f55078eb5815c1 7KB
21627fb1fcff6b3c79b01cc6c08687ba1e0a439773ed9be674784b80d62533282ca0e1db40f00f92e128a913324d61f266bcc97f02a2e9bfea480b8b84cd 9KB
21a960719064864f32e4f7bfcfd9e83ed80377e4f9a9754fe38bf7a68d5e 1KB
265978420c52fa59eddd6a78ddf13852c96a99036fac54a1bbc087609d29dfb4697645e36c41a092469d1d9b1b027152e0cb4e5f4075e8e5473f0d0a3cd5 731B
2695d03682fd1e716c75b71f508f6b46d4e54931350813d0481fb63e0efc9fa46b9e074c611ebefc0dd8ffe390e0b25e73bcc755447c40535253e262262c 5KB
29791c6e5081defacbaa0b0ab214143ddcd7edab4c7b45be778b85cbdd393f41ea53493dc06e7913562e4ea84b37a859ce18832aa68a46363984c70b2dab 5KB
npm-debug.log.3181811249 387KB
3886eadb2f94d33457d9d8c1659b6dd727c4d2c932d26b5022bae13a60d8 1KB
3b5f842e9892413c3599119ec94aee0e65760d325c6183e23c63ba46e083071a831ec9087328c7ba9e6b45506554082e3de3ec1b07eccc8e32d664e91956 1KB
442c5cd869dfa7e77c53cdd2cc2d52993f360dc28c6c1208a1dc26cc8a0c 1KB
45f95d00c20b88bf8d066219cd83155701b4597bad3933270d84592405851a77da7a38e7df0881cffd4e1a0c64dea1b5761da8a36a2b1126043a08cb4616 1KB
4734a2b0055b7edad01f233aef088ca42307913171eb357bccf17300742ec24a914e7a2aa9cfe47142480349c876bc9adcda5cd1381d85cac2c931d33382 456B
47b1efbb90044e87397d117555b1847f51e64bc0d09f54af8862bac178e6 1KB
4dba6dd006e6bfff8b2f899cb6c442931c39081145d2d7e4f762f22bb60e350380d03fc4342a1efe06a502e3d0fdd3a05c2b65ff97759870c55c09e0a28c 2KB
4f56166e9c6088489e76ab75a737d0dfb514f85fc8d685b8833cfd2a5c7c 1KB
5217be186139f873530df3008ce25e0e916adfd50df3822118ba0fab97ab 1KB
536285fa56db3b578ac741820a76b56845351b18e7df029ea8c2a5108dd4 1KB
542309f832e94fe9124957eb5996266041922636974cb5c067458d2ebc7f 1KB
56bdb4de458d6175e67aef1d1ec848ed245aac7fbdab06c48fa69829c3fb 1KB
5b771a80e1747c19cb3e8cc03c64b94358a3aceaf6f820c492abddb789588158473411ed1ac0f371ea5ed7ba25f7cc2b2e89148983867f72d8e51ed08c62 16KB
5c20437af2f703b1fae1f3c351c8b1d72c841d78a832d6bd97b89c92e1b718b18b1e1912069516a04e80c338ea10685d4bcb636e35de806fbd644858baae 6KB
5ca1f5cf21008d33c1c8c2ed9990b729ba43e986c43d2f3972047c7806b8c0442ef1f0480b2459428a8fb10895b83a54c6f8cc6290c8d13b47c6b54a4830 5KB
5ce9d4022a7c27b72b39b11366644014dd6fbc7d36fe768a88497d6d740a 1KB
623ac5bf126fa641fcbc302acc45cf7c84cfab330eeb600e7ed0ae2d51b7f2090f104ae966e1580b774c1e40a0d795e8dcbdf3b54810ede157eadaec79b5 15KB
65331d1917045204155d89d3294f8ab901d8eac396b2ac23380dfa988e216ff4bb0ebf4f71f55d89cb76d5c2fedf8b35ac9ab3eaa99c1ade1fc542dc224b 1KB
6a2c80e1eae373834d3e1b5eb41fd63ad8509fb070fa97e1ff0d1734abbbd95d978b90608ba00f1b75536b0cfdaf05e6b968f269ad8b39f6bc81bcb1957b 11KB
6bd396af267895c60a3882d6735a93e3b1d2f8c8469ae9d5e3d0af4df2c49abd0d4fb6cec1a2cbe633638df76dcaaead9fdc2480b6378cc406d8e5c91720 8KB
6d704ea30d10cfa17ae7bf531356f0abf21b71ffd6c3f0034647e327532789618a8fcec8fee839bc703e6ea08fa7156d571119616bb8c85e5d691245e886 9KB
6db1a42e42c729c9eeba5a970825fe4bd77ddd65b3feb7564203dc75b4e6d9308d557bf698fe956173c569f9bf6145bbf5435e18747c97149f7bfd9a23a7 456B
728d89d78b9b8a2895c27411af985e456d25bb4e24d51576fd1a6c57f08468865d7a654d7a153f34bca78bd5dd331c3d26ab04b162befd0db19b47b1b282 8KB
7735adac720b731e9f4d7e456d4710e4aaea58a55f48c31e56493113b1af 1KB
80f5f029adea07b02094fb54629eaf17ae5a73407c08c1a7803e06d93232e00bb96cef9709a4052c35fefb1f9cdfd7a42389e2ebd48be55fb39d26a8c4ae 7KB
84b0cd73228f89a52e13cff048ae7da35ddfe642d891c8e86ced552759fc84c7346127f75324724e09e5b4fa04c4f7125a20beb4cd8e79f4c3cb14b932b8 5KB
93dd1dafe28bb4fe09ef8981496b8ec3c878138d1158708fed203d04570a 1KB
95a925c73ba1d82d2226093beb8c78d0bf519f3b9d74e721dad8a302781c 1KB
9b50ca86f3618c682159a33d5a0e49f01e6d8c01d3263f0c5a4c53a0e11a45dbcf9669f53cbf63fc04a7bf83b2d45a55fa702aead66fbbd08693bcc55853 2KB
9c70cd02657c91a07746da66d51c89e36447e3b749270034e6cce4cbfca6 1KB
_editorconfig 160B
_editorconfig 121B
_gitignore 499B
a775d40b7a039c2886b97c4bd3ab7324f2b87ed8f007d7afbaf321e6f6c20ea53be24d265e5f0a6326fad0b1e4c4f116b93839b68ad21042b70347b404d0 2.93MB
a8d9d38e27e218055af075f46243e2733c574829319dea9f543bc9432eb1 1KB
a928c5c52d19a09c26b5881dc721537105c1f6e03ee15fa0f1608223b6af5ee827370fe5597a0b3518104bdb47717f2a157d498d63efa9f15668ae902653 6KB
acorn 2KB
acorn 325B
acorn 325B
acorn 325B
acorn 325B
acorn 325B
acorn 325B
acorn 325B
acorn 325B
acorn 319B
acorn 313B
acorn 313B
acorn 301B
acorn 301B
acorn 301B
acorn 301B
acorn 301B
acorn 301B
acorn 301B
acorn 62B
acorn 59B
acorn 59B
acorn 59B
acorn 59B
acorn 59B
address 692B
ae0c992d2f15326e871a5c02209401408cc26398b95163d67b208fe4fbe3 1KB
aeafb655e57578c7673af2e72b0bfcc7ae81270599aaa1761eca368a6dbc2b6f70b01cc46f61e6ab934716bea1585a8b3e5750af02a7565c49b13004cf68 23KB
license.after 4B
ansi-html 2KB
ansi-html 329B
ansi-html 317B
LICENSE.APACHE2 586B
openChrome.applescript 2KB
atob 315B
atob 303B
AUTHORS 1KB
AUTHORS 1KB
AUTHORS 1KB
共 39221 条
- 1
- 2
- 3
- 4
- 5
- 6
- 393
资源评论
- qq_351417442020-03-23密码是啥啊
Jaxplum
- 粉丝: 0
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- YOLO-yolo资源
- 适用于 Java 项目的 Squash 客户端库 .zip
- 适用于 Java 的 Chef 食谱.zip
- Simulink仿真快速入门与实践基础教程
- js-leetcode题解之179-largest-number.js
- js-leetcode题解之174-dungeon-game.js
- Matlab工具箱使用与实践基础教程
- js-leetcode题解之173-binary-search-tree-iterator.js
- js-leetcode题解之172-factorial-trailing-zeroes.js
- js-leetcode题解之171-excel-sheet-column-number.js
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功