Okay, for people who like to add a colorpicker to hex value to PME. This will be shown in a new popup window:
1. Here is the code for $opts, modify this as you like for each field which contains a color code (thanks to spudnukem):
Kód: |
$opts['fdd']['color']['help'] = 'Select Color : <a href=JavaScript:void(0); onclick=window.open("colorpicker.php?e=PME_data_color","SelectColor","height=330,width=560,left=100,top=100,resizable=no,scrollbars=no,toolbar=no,status=no")>click here</a>'; |
The javascript and images for the colorpicker (i've been using) can be find here:
http://blog.paranoidferret.com/index.php/2007/08/22/javascript-interactive-color-picker/
Just download the images and the javascript.js at the end of the page.
Now make a file called colorpicker.php and add the follow code below.
Have fun!
Gr,
Mark Lupker
Colorpicker.php:
Kód: |
<?php
$formelement = $_GET['e'];
?>
<style>
body {
background-color:#ffffff;
color:#000000;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
}
table, td, tr {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
</style>
<!--
///////////////////////////////////////
Color Picker Code Starts Here
///////////////////////////////////////
-->
<script type="text/javascript" src="javascript.js"></script>
<div style="position:relative;height:306px;width:531px;border:1px solid black;">
<div id="gradientBox" style="cursor:crosshair;position:absolute;top:15px;left:15px;width:256px;height:256px;">
<img id="gradientImg" style="display:block;width:256px;height:256px;" src="images/color_picker_gradient.png" />
<img id="circle" style="position:absolute;height:11px;width:11px;" src="images/color_picker_circle.gif" />
</div>
<div id="hueBarDiv" style="position:absolute;left:310px;width:35px;height:256px;top:15px;">
<img style="position:absolute;height:256px;width:19px;left:8px;" src="images/color_picker_bar.png" />
<img id="arrows" style="position:absolute;height:9px;width:35px;left:0px;" src="images/color_picker_arrows.gif" />
<br />
</div>
<div style="position:absolute;left:370px;width:145px;height:256px;top:15px;">
<div style="position:absolute;border: 1px solid black;height:50px;width:145px;top:0px;left:0px;">
<div id="quickColor" style="position:absolute;height:50px;width:73px;top:0px;left:0px;"></div>
<div id="staticColor" style="position:absolute;height:50px;width:72px;top:0px;left:73px;"></div>
</div>
<br />
<table width="100%" style="position:absolute;top:55px;">
<tr>
<td>Hex: </td>
<td>
<input size="8" type="text" id="hexBox" onchange="hexBoxChanged();" />
</td>
</tr>
<tr>
<td>Red: </td>
<td>
<input size="8" type="text" id="redBox" onchange="redBoxChanged();" />
</td>
</tr>
<tr>
<td>Green: </td>
<td>
<input size="8" type="text" id="greenBox" onchange="greenBoxChanged();" />
</td>
</tr>
<tr>
<td>Blue: </td>
<td>
<input size="8" type="text" id="blueBox" onchange="blueBoxChanged();" />
</td>
</tr>
<tr>
<td>Hue: </td>
<td>
<input size="8" type="text" id="hueBox" onchange="hueBoxChanged();" />
</td>
</tr>
<tr>
<td>Saturation: </td>
<td>
<input size="8" type="text" id="saturationBox" onchange="saturationBoxChanged();" />
</td>
</tr>
<tr>
<td>Value: </td>
<td>
<input size="8" type="text" id="valueBox" onchange="valueBoxChanged();" />
</td>
</tr>
<tr>
<td></td>
<td align="right">
<a href="javascript:void();" onclick="window.opener.document.forms[0].<? echo $formelement; ?> .value=currentColor.HexString(); window.close();" ><img src="images/ok.jpg" border="0"></a>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
fixGradientImg();
var currentColor = Colors.ColorFromRGB(64,128,128);
new dragObject("arrows", "hueBarDiv", arrowsLowBounds, arrowsUpBounds, arrowsDown, arrowsMoved, endMovement);
new dragObject("circle", "gradientBox", circleLowBounds, circleUpBounds, circleDown, circleMoved, endMovement);
colorChanged('box');
</script>
<!--
///////////////////////////////////////
Color Picker Code Ends Here
///////////////////////////////////////
-->
|
|
A color picker is a valuable tool in digital design and creative projects, allowing users to precisely select and match colors from an extensive spectrum. This tool simplifies the process of choosing hues, ensuring visual harmony in designs, websites, or artworks. Moreover, for businesses in the food sector, such as bakeries, the color picker becomes a particularly essential instrument, enabling the selection of natural colors that evoke a sense of freshness and authenticity, aligning perfectly with themes like
Natural Colors for bakery
. From graphic designers aiming for a cohesive brand palette to web developers fine-tuning the aesthetics of a website, the color picker facilitates precision and consistency. In various industries, it plays a pivotal role, in helping users create visually appealing and professional-looking content.
|