#include <StylePallet.h>


StylePallet :: StylePallet()
{
/* Line Style Example:
        ("set style line 1  lc rgb '#4CC448' lt 1 lw 1.0"); // green
*/

	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "green",     "#4CC448", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "blue",      "#0025ad", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "red",       "#FF0000", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "pink",      "#CC00CC", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "yellow",    "#CCCC00", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "lightblue", "#00BFFF", 1, 1.0));
	lineStyle_.push_back(new LineStyle(lineStyle_.size()+1, "purple",    "#4000FF", 1, 1.0));


}


LineStyle * StylePallet :: lineStyle(string s)
{
	int i=0;
	while ( lineStyle_[i]->name() != s )
		i++;

	return lineStyle_[i];
}


LineStyle * StylePallet :: lineStyle(int id)
{
	return lineStyle_[id-1];
}


void StylePallet :: type(int t)
{
	for (int i=0; i < lineStyle_.size(); i++)
	{
		lineStyle_[i]->type(t);
	}
}


void StylePallet :: width(float w)
{
	for (int i=0; i < lineStyle_.size(); i++)
	{
		lineStyle_[i]->width(w);
	}
}


