Skip to content

Commit

Permalink
changed the project name in build and phpdox, formatted some
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeemoo committed Oct 8, 2012
1 parent 5e6c277 commit 655a79c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="name-of-project" default="build">
<project name="ColorJizz-PHP" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,phpcb"/>

Expand Down
2 changes: 1 addition & 1 deletion phpdox.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpdox xmlns="http://phpdox.de/config">
<project name="name-of-project" source="src" workdir="build/phpdox">
<project name="ColorJizz-PHP" source="src" workdir="build/phpdox">
<collector publiconly="false">
<include mask="*.php" />
<exclude mask="*Autoload.php" />
Expand Down
5 changes: 1 addition & 4 deletions src/MischiefCollective/ColorJizz/ColorJizz.php
Expand Up @@ -110,18 +110,15 @@ public function distance(ColorJizz $destinationColor)
*/
public function websafe()
{

$palette = array();

for ($r = 0; $r <= 255; $r += 51) {
for ($g = 0; $g <= 255; $g += 51) {
for ($b = 0; $b <= 255; $b += 51) {
$palette[] = new RGB($r, $g, $b);
}
}
}

return $this->match($palette);
return $this->match($palette);
}

/**
Expand Down
40 changes: 20 additions & 20 deletions src/MischiefCollective/ColorJizz/Formats/CIELab.php
Expand Up @@ -24,19 +24,19 @@ class CIELab extends ColorJizz
* The lightness
* @var float
*/
public $l;
public $lightness;

/**
* The a dimenson
* The a dimension
* @var float
*/
public $a;
public $a_dimension;

/**
* The b dimenson
* @var float
*/
public $b;
public $b_dimension;

/**
* Create a new CIELab color
Expand All @@ -45,17 +45,17 @@ class CIELab extends ColorJizz
* @param float $a The a dimenson
* @param float $b The b dimenson
*/
public function __construct($l, $a, $b)
public function __construct($lightness, $a_dimension, $b_dimension)
{
$this->toSelf = "toCIELab";
$this->l = $l; //$this->roundDec($l, 3);
$this->a = $a; //$this->roundDec($a, 3);
$this->b = $b; //$this->roundDec($b, 3);
$this->lightness = $lightness; //$this->roundDec($l, 3);
$this->a_dimension = $a_dimension; //$this->roundDec($a, 3);
$this->b_dimension = $b_dimension; //$this->roundDec($b, 3);
}

public static function create($l, $a, $b)
public static function create($lightness, $a_dimension, $b_dimension)
{
return new CIELab($l, $a, $b);
return new CIELab($lightness, $a_dimension, $b_dimension);
}

/**
Expand Down Expand Up @@ -108,10 +108,10 @@ public function toXYZ()
} else {
$var_Z = ($var_Z - 16 / 116) / 7.787;
}
$x = $ref_X * $var_X;
$y = $ref_Y * $var_Y;
$z = $ref_Z * $var_Z;
return new XYZ($x, $y, $z);
$position_x = $ref_X * $var_X;
$position_y = $ref_Y * $var_Y;
$position_z = $ref_Z * $var_Z;
return new XYZ($position_x, $position_y, $position_z);
}

/**
Expand Down Expand Up @@ -179,20 +179,20 @@ public function toCIELCh()
$var_H = 360 - (abs($var_H) / pi()) * 180;
}

$l = $this->l;
$c = sqrt(pow($this->a, 2) + pow($this->b, 2));
$h = $var_H;
$lightness = $this->lightness;
$chroma = sqrt(pow($this->a_dimension, 2) + pow($this->b_dimension, 2));
$hue = $var_H;

return new CIELCh($l, $c, $h);
return new CIELCh($lightness, $chroma, $hue);
}

/**
* A string representation of this color in the current format
*
* @return string The color in format: $l,$a,$b
* @return string The color in format: $lightness,$a_dimension,$b_dimension
*/
public function __toString()
{
return sprintf('%s,%s,%s', $this->l, $this->a, $this->b);
return sprintf('%s,%s,%s', $this->lightness, $this->a_dimension, $this->b_dimension);
}
}

0 comments on commit 655a79c

Please sign in to comment.