PrestaShop/PrestaShop — pull request #1431 by PhpMadman (2014-02-18 09:55:41+00:00)
Title: [+] BO : Code improvement for tiny mce colorpicker

Since it's a minified file, the diffrence is hard to se.
But what I did is insted of document.getElementById("selector2").onclick=function(){cp.setHex("#D4D4D4")} calling that for each selector, I replaced it with my setColor function.

```javascript
function setColor(element)
{
var hex = element.style.backgroundColor;
var arr = hex.split(",");
var r = arr[0].substring(4),g = arr[1],b = arr[2].substring(0,arr[2].length-1);
if (hex.indexOf('rgb') == 0)
{
hex = ColorPicker.rgb2hex({r:arr[0].substring(4),g:arr[1],b:arr[2].substring(0,arr[2].length-1)});
}
cp.setHex(hex);
}
```
This allows for more easy customization of the default selector colors, and it's also less code.
If anyone wants to replace a color, they just need to edit the index.html.

And if anyone know how to make the color dialog wider, it's an easy task to add another color.