Location: PHPKode > scripts > myColors > vylson-silwr-myColors-2550f71/core/AbstractFormula.php
<?php

	/**
	 * myColors
	 *
	 * Discover Your Colors!
	 *
	 * @author vylson silwr <hide@address.com>
	 * @version 1.0
	 * @copyright   (C)2007 vylson silwr- GNU GPL
	 * @license       http://www.gnu.org/licenses/gpl.html GNU General public License
	 * @package myColors
	 */

	// -----------------AbstractFormula.php-------------------- //

	require_once '../functions/hexColors.func.php';
	require_once 'convert.class.php';

	/**
	 *  class AbstractFormula
	 *
	 * base class for formula classes
	 *
	 *
	 */

	abstract class AbstractFormula
	{

		/**
		 * initial hex color
		 *
		 * @var string
		 */

		protected $_color;

		/**
		 * default class variables
		 *
		 * @var float
		 */

		protected $_hue, $_saturation, $_lightness, $_darkness, $_red, $_green, $_blue;

		/**
		 * hex codes  for red , green and blue
		 *
		 * @var string
		 */

		protected $_red_hex, $_green_hex, $_blue_hex;

		/**
		 * degree value
		 *
		 * @var int
		 */

		protected $_degree;

		/**
		 * array of hex code=> rgb values
		 *located in separate file
		 * @file location '/functions/hexColors.func.php'
		 *
		 * @var array
		 */

		protected $_colors = array();

		/**
		 * instance of convert class
		 *
		 * @var object
		 */

		public $_convert;
		/**
		 * array of rgb values => hex code
		 *located in separate file
		 * @file location '/functions/hexColors.func.php'
		 *
		 * @var array
		 */

		protected $_get_hex_from_number = array();

		/**
		 *constructor
		 *
		 * initial settings from source array
		 *
		 * @return void
		 */

		public function __construct(array $source)
		{
			$this -> _red = $source['red_number'];
			$this -> _green = $source['green_number'];
			$this -> _blue = $source['blue_number'];
			$this -> _color = $source['hex'];
			$this -> _red_hex = $source['hex_red'];
			$this -> _green_hex = $source['hex_green'];
			$this -> _blue_hex = $source['hex_blue'];
			$this -> _degree = $source['degree'];
			$this -> _colors = colors();
			$this -> _get_hex_from_number = colors(FALSE);
			$this -> _convert = new convert();

		}

		/**
		 * abstract method which must be created in child classes
		 *
		 * @return string
		 */

		abstract protected function output();

	}

	//--------------class ends---------------//
Return current item: myColors