package ui;

import openfl.Assets;
import openfl.geom.ColorTransform;
import format.SVG;
import openfl.display.Shape;

class SVGIconFactory {
	public static function makeIcon(pSvgIconPath:String = null, pIconSize:Int = 64, pIconColor:Int = 0x000000):Shape {
		
		var svgIcon:Shape = new Shape();
		new SVG(Assets.getText(pSvgIconPath)).render(svgIcon.graphics);

        var ct = new ColorTransform();
        ct.color = pIconColor;
        svgIcon.transform.colorTransform = ct;

		svgIcon.width = svgIcon.height = pIconSize;

		return svgIcon;

	}
}
