雅虎UI 取色器 【笨笨 20151005】(使用HTA实现UI)

10 篇文章 0 订阅

有时想查看下颜色的16进制和RGB转的。这都要打开PS也太坑了。

20151005 国庆在家东拼西凑的。
大家好,我是笨笨,笨笨的笨,笨笨的笨。

用的是雅虎的UI库,所以就叫“雅虎UI 取色器 ”了(不是单文件,所以放到百度盘了。以后有心情可以考虑用自解压打个包)

链接: http://pan.baidu.com/s/1bnnw8KR 密码: whsm

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<!-- 
有时想查看下颜色的16进制和RGB转的。这都要打开PS也太坑了。
20151005 国庆在家东拼西凑的。
大家好,我是笨笨,笨笨的笨,笨笨的笨。
-->
<head>
<title>雅虎UI 取色器 【笨笨 20151005】   http://blog.csdn.net/jx520</title>
<script type="text/javascript">
while (true) {
    try {
        var width = 500, height = 350;
        window.resizeTo(width, height);
        window.moveTo((window.screen.width - width) / 2, (window.screen.height - height) / 2);
        break;
    } catch (e) { continue; }
}
</script>


<HTA:APPLICATION
  APPLICATIONNAME="ColorPicker"
  ID="JHTA"
  VERSION="1.0"
  BORDER="dialog"
  SCROLL="no"
  SINGLEINSTANCE="yes"
  CONTEXTMENU="yes"
  NAVIGABLE="yes"/>




<style type="text/css">
/*margin and padding on body element
  can introduce errors in determining
  element position and are not recommended;
  we turn them off as a foundation for YUI
  CSS treatments. */
body {
	margin:0;
	padding:0;
	text-align: center;
}


</style>


<!-- Dependencies -->
<script src="./script/utilities.js" ></script>
<script src="./script/slider-min.js" ></script>
 
<!-- Color Picker source files for CSS and JavaScript -->
<link rel="stylesheet" type="text/css" href="./css/colorpicker.css">
<link rel="stylesheet" type="text/css" href="./css/fonts-min.css" />
<script src="./script/colorpicker-min.js" ></script>


<!--begin custom header content for this example-->
<style type="text/css">
  #container { position: relative; padding: 6px; background-color: #eeeeee; width: 420px; height:180px; }
  #container .yui-picker-controls li {
    list-style: none;
  }
</style>






<!--end custom header content for this example-->


</head>


<body class="yui-skin-sam">




<h1>Color Picker</h1>


<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->


<div id="container">
</div>


<!--We'll use these to trigger interactions with the Color Picker
API -->
<p/>


<button id="reset" style=" width:200px;">重置为白色</button>
<button id="gethex" style=" width:200px;">复制颜色值</button> 


<script type="text/javascript">
(function() {
    var Event = YAHOO.util.Event,
        picker;


    Event.onDOMReady(function() {
//			YAHOO.log("Creating Color Picker.", "info", "example");
            picker = new YAHOO.widget.ColorPicker("container", {
                    showhsvcontrols: true,
                    showhexcontrols: true,
					images: {
						PICKER_THUMB: "assets/picker_thumb.png",
						HUE_THUMB: "assets/hue_thumb.png"
    				}
                });
//			YAHOO.log("Finished creating Color Picker.", "info", "example");
			
			//a listener for logging RGB color changes;
			//this will only be visible if logger is enabled:
			var onRgbChange = function(o) {
				/*o is an object
					{ newValue: (array of R, G, B values),
					  prevValue: (array of R, G, B values),
					  type: "rgbChange"
					 }
				*/
				//YAHOO.log("The new color value is " + o.newValue, "info", "example");
			}
			
			//subscribe to the rgbChange event;
			picker.on("rgbChange", onRgbChange);
			
			//use setValue to reset the value to white:
			Event.on("reset", "click", function(e) {
				picker.setValue([255, 255, 255], false); //false here means that rgbChange
													     //wil fire; true would silence it
			});
			
			//use the "get" method to get the current value
			//of one of the Color Picker's properties; in 
			//this case, we'll get the hex value and write it
			//to the log:
			Event.on("gethex", "click", function(e) {
			//YAHOO.log("Current hex value: " + picker.get("hex"), "info", "example"); 
				//window.prompt("复制颜色值: Ctrl+C, 回车", "text");
				var meintext = document.getElementById("yui-picker-hex").value;
				window.clipboardData.setData("Text", meintext);
//=====================
document.getElementById("tips").style.background ="#"+meintext;
var attributes = {
	top:  { from: 100, to: 100, unit: 'px' },
	top:  {from: 100, by: -200 }
}; 
var myAnim = new YAHOO.util.Anim('tips', attributes);
myAnim.duration = .7;
myAnim.method = YAHOO.util.Easing.easeIn;
myAnim.animate();


//==========================visibility:hidden;
			});
        });
})();
</script>


<!--END SOURCE CODE FOR EXAMPLE =============================== -->


<div id="tips" style="background:#888888;padding:20px;
position:absolute; left:120px; top:500px;
width:200px; height:25px; z-index:1;border-color : #969696; "><div style="background:#888888;color:white;font-weight:bold;">复制成功!</div></div>


</body>
</html>


<!-- SpaceID=0 robot -->


<!-- VER-3.0.235613 -->
<!-- doc3.ydn.gq1.yahoo.com compressed/chunked Tue Jul 30 21:13:48 PDT 2013 -->

 

 

 

 

 

对于MSP432微控制器的RT-Thread操作系统移植,您可以按照以下步骤进行操作: 1. 准备工作: - 下载RT-Thread源代码:从RT-Thread官方网站下载最新版本的源代码。 - 安装MSP432开发环境:确保您已经安装了MSP432的开发环境,包括MSP432 LaunchPad开发板和相关软件。 2. 创建MSP432的板级支持包(BSP): - 在RT-Thread的bsp文件夹下创建一个新的目录,命名为msp432。 - 在msp432目录下创建一个board.c文件,实现与MSP432开发板相关的初始化函数,如时钟配置、中断配置等。 - 根据MSP432的数据手册和参考手册,编写板级支持包的代码,以适配MSP432的硬件。 3. 配置RT-Thread内核: - 在RT-Thread的env目录下创建一个新的目录,命名为msp432。 - 在msp432目录下创建一个rtconfig.h文件配置RT-Thread内核的相关选项,如内存大小、线程数量等。 - 根据MSP432的特性和需求,进行相应的内核配置。 4. 编译和烧录: - 进入RT-Thread的根目录,执行menuconfig命令进行配置,选择MSP432平台和相应的BSP。 - 执行scons命令,编译RT-Thread操作系统。 - 使用MSP432开发环境将生成的可执行文件烧录到MSP432开发板上。 5. 应用程序开发: - 在RT-Thread的applications目录下编写应用程序代码,实现您的功能。 - 在bsp/msp432目录下添加驱动代码或配置文件,以支持您的应用程序。 - 编译和烧录应用程序到MSP432开发板上。 这些是大致的步骤,具体的移植过程可能会因各种因素而有所不同。您可以参考RT-Thread官方文档和MSP432的相关资料,以获取更详细的移植指南。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

笑虾

多情黯叹痴情癫。情癫苦笑多情难

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值