Contents
Login Register Wishes Forum About
Language Reference » Misc functions » loadPalette
Help topics
Latest updates
4574d  replaceImageMapTitle
4574d  replaceImageMapValues
4574d  createFunctionSerie
4574d  setAbsicssaPosition
4574d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
loadPalette - Load a color scheme and apply it

This function allows you to load a color scheme from a flat file or an internet location. You can specify it the loaded palette will be appended to the current one or if it will overwrite the current color scheme.

Calling this function
loadPalette($FileName,$Overwrite=FALSE);
Where :

FileName is the name of the file to load. It can be a local path or a remote location.
Overwrite is an optional parameter. Set to TRUE it will overwrite the current palette.


What is a color scheme

A color scheme is a text file containing a list of colors. Colors are composed of their Red, Green, Blue and Alpha properties. To create your own color scheme, just create a CSV file using a coma as delimiter between the parameters and a carriage return to separate the colors :
239,210,121,100
149,203,233,100
2,71,105,100
175,215,117,100
44,87,0,100
222,157,127,100

Sample script


 /* Create the pData object */
 $MyData = new pData(); 

 /* Will append the "autumn" palette to the current one */
 $MyData->loadPalette("palettes/autumn.color");

 /* Will replace the whole color scheme by the "desert" palette */
 $MyData->loadPalette("palettes/desert.color", TRUE);
Last updated on 11/04/2009 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,20 seconds. Wiki revision 1.37.