简体   繁体   English

chrome开发人员工具源代码

[英]chrome developer tool source code

I want to create my own color picker extention like color picker tool of chrome dev tool. 我想创建自己的颜色选择器范围,例如chrome dev工具的颜色选择器工具。 Chrome's color picker tool is very nice. Chrome的颜色选择器工具非常好。 So my question is: how can i get chrome's color picker tool source code? 所以我的问题是:如何获取chrome的拾色器工具源代码? Thanks a lot. 非常感谢。

While Google Chrome is not an open source application, Chromioum is. 虽然Google Chrome浏览器不是开源应用程序,但Chromioum却是。 You can download its entire open source here and try to extract the color pallet mechanisms . 您可以在此处下载其完整的开放源代码并尝试提取调色板机制

Besides diving into this massive and complex code, you have plenty of other Javascript based color picker tools you can implement very easily. 除了深入研究这些庞大而复杂的代码之外,您还可以使用许多其他基于Java的颜色选择器工具,这些工具可以非常轻松地实现。 Take a look at JColor , which I'm using myself and very satisfied. 看一看JColor ,我正在使用我自己并且非常满意。

Using this Javascript library will be much more easier than extracting and implementing the dev tools color pallete, it's a 2 line implementation, which will give you pretty much the same functionality: 使用此Javascript库比提取和实现开发工具颜色调色板容易得多,它是两行实现,将为您提供几乎相同的功能:

<script src="jscolor.js"></script>
Color: <input class="jscolor" value="ab2567">

Besides that, You can search for more Javascript libraries out in the vastness of the internet. 除此之外,您还可以在互联网上搜索更多的Javascript库。

The color picker used in the devtool is a module listed here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/color_picker/ devtool中使用的颜色选择器是此处列出的模块: https ://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/color_picker/

It is a relatively large module so I will not link it here nor recommend you to use it in your future extensions. 它是一个相对较大的模块,因此我不会在此处链接它,也不建议您在以后的扩展中使用它。 However if you do have the patience, you can definitely pick out the parts that you need and use it under the licenses described in the files. 但是,如果您确实有耐心,则可以绝对选择所需的零件,并在文件中所述的许可下使用它。

Eye Dropper Tool: 滴管工具:

I believe the color picker you are refering to is Google Chrome Eye Dropper tool. 我相信您所指的颜色选择器是Google Chrome滴管工具。 After looking into it, I think I found a GitHub page with a verified source code of this type of tool, if this is what you were refering to. 研究完之后,我想我找到了一个GitHub页面,其中包含您所指的经过验证的此类工具的源代码。

Source Code: 源代码:

Below are two links. 以下是两个链接。 The first link is to the Google Chrome Webstore page, where you will find the Eye Dropper Tool. 第一个链接是Google Chrome Webstore页面,您可以在其中找到吸管工具。 If this is the tool you were refering to, then the second link will be the source code for it. 如果这是您所引用的工具,则第二个链接将是它的源代码。

Here is the Tool: https://chrome.google.com/webstore/detail/eye-dropper/hmdcmlfkchdmnmnmheododdhjedfccka?hl=en 这是工具: https//chrome.google.com/webstore/detail/eye-dropper/hmdcmlfkchdmnmnmheododdhjedfccka?hl = zh-CN

Here is the Source Code: https://github.com/kepi/chromeEyeDropper 这是源代码: https : //github.com/kepi/chromeEyeDropper

Hopefully this helps you out! 希望这可以帮助您!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM