├── .gitmodules ├── .gitignore ├── css └── styles.css ├── LICENSE ├── README.md └── dynamic-create.php /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 27 | node_modules 28 | -------------------------------------------------------------------------------- /css/styles.css: -------------------------------------------------------------------------------- 1 | .pantone-group { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | justify-content: space-around; 6 | align-items: flex-start; 7 | align-content: space-around; 8 | 9 | } 10 | 11 | ul, li { 12 | margin: 0; 13 | padding: 0; 14 | } 15 | li { 16 | list-style: none; 17 | list-style-type: none; 18 | } 19 | .pantone-swatch { 20 | width: 200px; 21 | height: 150px; 22 | margin: 5px; 23 | padding: 10px; 24 | } 25 | /* make swatches full width for mobile screens */ 26 | @media screen and (max-width: 450px) { 27 | .pantone-swatch { 28 | width: 100%; 29 | margin: 5px 0; 30 | } 31 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Alexander Donald 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Pantone-CMYK-RGB-Hex 2 | ==================== 3 | 4 | About 5 | ----- 6 | 7 | Conversion table for Pantone PMS to CMYK, RGB, and Hex values. 8 | 9 | The index.html file is completely self contained. Just drop it onto a server and it will work, all the CSS is either in the styles.css file, or inline. I know inline css is "A Bad Thing", but it was far simpler to add the bottom border colour inline for each colour. 10 | 11 | The .json file is an array of all the Pantone colours, including the PMS code, CMYK values, RGB values, and Hexadecimal values. 12 | 13 | The dynamic-create.php file does what it says on the tin; it iterates through the .json file and dynamically creates the html you will find in index.html. 14 | 15 | Please note that the colours on your screen may display very differently to those you print. That is the whole reason for colour matching systems like Pantone in the first place. This is merely meant to be a rough guide to what colour you can expect. 16 | 17 | Let me know if I've missed anything! 18 | 19 | To-Do 20 | ----- 21 | 22 | Set up a php script that only outputs results of a search. This would use "dynamic-create.php" with some input variables. 23 | 24 | Acknowledgments 25 | --------------- 26 | 27 | I used the Pantone to CMYK reference at [Excalibur Creations](http://www.excaliburcreations.com/pantone.html "Excalibur Creations Pantone to CMYK"), then calculated the RGB, and therefore Hex, values using the equations at [Rapid Tables](http://www.rapidtables.com/convert/color/cmyk-to-rgb.htm "Rapid Tables CMYK to RGB") 28 | -------------------------------------------------------------------------------- /dynamic-create.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | Pantone Converter | www.alexdonald.co.uk 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

Pantone Converter

20 |

See Pantone Conversion JSON file for raw data

21 |
22 | 23 |
24 | $value) { 27 | // add "Pantone" to beginning of Code title if just a number 28 | if (ctype_digit(substr($value["Code"], 0, 3))) { 29 | $pantone_title = "Pantone " . $value["Code"]; 30 | } else { 31 | $pantone_title = $value["Code"]; 32 | } 33 | echo " 34 | "; 40 | } 41 | ?> 42 |
43 | 44 | --------------------------------------------------------------------------------