Talk:How to legally obtain spot colour palettes for use in Scribus 1.3.3.x and later versions: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 23: Line 23:
echo '</SCRIBUSUTF8NEW>';
echo '</SCRIBUSUTF8NEW>';
?>
?>
Oberten, can you add this to the article?
</pre>
</pre>



Revision as of 23:14, 28 January 2007

I'm writing here cause I'm new to this wiki... and pretty new to Scribus too...

Pantone website

Another way to legally obtain Pantone colour palettes is to use a file that's freely available from Pantone's official website. This file contains all the colour names and the sRGB values for the PANTONE® FORMULA GUIDE coated. A few code lines can transform this into a colour swatch or a Scribus document to import into your colour library.

Here is a basic sample code in php:

<?php
$handle = fopen("http://www.pantone.com/popups/inspireme/colors.txt", "rb");
$contents = stream_get_contents($handle);
fclose($handle);
$content_array = explode('= ', $contents);

echo '<SCRIBUSUTF8NEW Version="1.3.3.6" >'.chr(13).chr(10);
echo ' <DOCUMENT>'.chr(13).chr(10);
foreach($content_array as $color) {
	$color_name = substr($color, 0, strpos($color, chr(13)));
	$sRGB_equivalent = substr($color, strpos($color, chr(13))+14, 6);
	if($color_name != '' && $color_name != 'blank')
		echo '  <COLOR Register="0" Spot="1" RGB="#'.$sRGB_equivalent.'" NAME="'.$color_name.'" />'.chr(13).chr(10);
};
echo ' </DOCUMENT>'.chr(13).chr(10);
echo '</SCRIBUSUTF8NEW>';
?>

Oberten, can you add this to the article?

You can see it at work here. (source)

Olivier Berten 23:49, 28 January 2007 (CET)