Цвет шрифта
(custom)
<script type="text/javascript" src="../js/farbtastic.js"></script>
<link rel="stylesheet" href="../css/farbtastic.css" type="text/css" />
<div id="textColorButton" style="margin: 0 auto;"></div>
<script language="javascript">
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
function HexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function HexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function HexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function decToHex(number) { if (number < 0) { number = 0xFFFFFFFF + number + 1; }
return number.toString(16).toUpperCase(); }
$('#textColorButton').farbtastic( function (color) {
r = HexToR(color);
g = HexToG(color);
b = HexToB(color);
$.get("/objects/?object=ButtonSettings&op=set&p=textColor&v="+cutHex(color));
});
$.get("/objects/?object=ButtonSettings&op=get&p=textColor", function (data) { $.farbtastic("#textColorButton").setColor("#"+data); });
</script>