You can use different colours specifications in ImageMagick ( you will need to escape the ( ) ).
| Specification | Format example | Result |
|---|---|---|
| Name | Cyan |
|
| HEX | #00ffff You may need use ' around the colour '#00ffff' |
|
| RGB | rgb\(0,255,255\) |
|
| RGBA | rgba\(0,255,255,1\) |
|
| HSL | hsl\(180,100,50\) |
|
| HSLA | hsla\(180,100,50,1.0\) |
|
| CMYK | cmyk\(100,0,0,0\) |
|
| CMYKA | cmyka\(100,0,0,0,100\) |
|
The code to produce the colour patchs, just replace the colour section with the examples above.
<?php
exec("convert -size 50x20 xc:cmyka(100,0,0,0) cmyka.jpg");
?>
Note: Do not leave spaces between the colours; although the ImageMagick website says it will be OK. e.g. rgb\(255, 0, 0\) will not work but rgb\(255,0,0\) will work.