You are on page 1of 2

<!-- Save as .hta.

This is a software to get hex code or values RGB from colors


//-->

<head>
<meta charset="UTF-8">
<title>Color Picker</title>
<HTA:APPLICATION
Application ID = "ColorPicker"
APPLICATIONNAME = "ColorPicker"
BORDER = "Thin"
BORDERSTYLE = "Normal"
CAPTION = "Yes"
CONTEXTMENU = "no"
ICON = "220.ico"
INNERBORDER = "no"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "Yes"
RESIZE = "No"
SCROLL = "No"
SCROLLFLAT = "No"
SELECTION = "No"
SHOWINTASKBAR = "Yes"
SINGLEINSTANCE = "Yes"
SYSMENU = "yes"
VERSION = "1.0"
WINDOWSTATE = "Normal"
/>
</head>

<script language="VBscript">

dim cx, cy
window.resizeTo 240,280
With Window.Screen
cx = (.AvailWidth - 240 ) \ 2
cy = (.AvailHeight - 280 ) \ 2
End with

dim intR, intG, intB

window.moveTo cx,cy

sub window_onLoad

intR = 255
intG = 255
intB = 255

corHex.value = "#FFFFFF"
corRed.value = intR
corGre.value = intG
corBlu.value = intB

end sub

sub abrePaleta
cor = dlgHelper.ChooseColorDlg(RGB(intR,intG,intB))
cor = hex(cor)
do while len(cor) < 6
cor = "0" & cor
loop
cor = "#" & cor
amostra.style.backgroundColor = cor
corHex.value = cor
intR = CInt("&h" & mid(cor, 2, 2))
intG = CInt("&h" & mid(cor, 4, 2))
intB = CInt("&h" & mid(cor, 6, 2))
corRed.value = intR
corGre.value = intG
corBlu.value = intB
document.parentWindow.clipboardData.setData "text", cor
end sub

</script>

<body style="font-family:Calibri; font-


size:12pt;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,
StartColorStr='#FFFFFF', EndColorStr='#B4C1D6');">
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b"
width="0px" height="0px"></OBJECT>
<div style="text-align:center">
<input type="button" value="Exibir paleta" onClick="abrePaleta"><br><br>
<div id="amostra" style="width:80px; height:40px; background-color:#ffffff;
border:1px solid #454545;">&nbsp;</div><br><br>
Hexadecimal: <input type="text" id="corHex" size="8"><br><br>
RGB: <input type="text" id="corRed" size="1"><input type="text" id="corGre"
size="1"><input type="text" id="corBlu" size="1">
</div>
</body>

You might also like