forked from MarcusSchwarz/lesserphp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start removing some code smell and remove lessify-only parts
- Loading branch information
Marcus Schwarz
committed
Mar 1, 2017
1 parent
82049ab
commit adeeaa6
Showing
16 changed files
with
397 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
namespace LesserPhp; | ||
|
||
/** | ||
* lesserphp | ||
* https://www.maswaba.de/lesserphp | ||
* | ||
* LESS CSS compiler, adapted from http://lesscss.org | ||
* | ||
* Copyright 2013, Leaf Corcoran <leafot@gmail.com> | ||
* Copyright 2016, Marcus Schwarz <github@maswaba.de> | ||
* Licensed under MIT or GPLv3, see LICENSE | ||
* @package LesserPhp | ||
*/ | ||
class Color | ||
{ | ||
|
||
private $r; | ||
private $g; | ||
private $b; | ||
private $type; | ||
private $alpha; | ||
|
||
/** | ||
* Color constructor. | ||
* | ||
* @param string $type | ||
* @param int $r | ||
* @param int $g | ||
* @param int $b | ||
* @param float|null $alpha | ||
*/ | ||
public function __construct($type, $r, $g, $b, $alpha = null) | ||
{ | ||
$this->type = $type; | ||
$this->r = $r; | ||
$this->g = $g; | ||
$this->b = $b; | ||
$this->alpha = $alpha; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getR() | ||
{ | ||
return $this->r; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getG() | ||
{ | ||
return $this->g; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getB() | ||
{ | ||
return $this->b; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function getRgb() | ||
{ | ||
return [$this->r, $this->g, $this->b]; | ||
} | ||
|
||
/** | ||
* @return null|float | ||
*/ | ||
public function getAlpha() | ||
{ | ||
return $this->alpha; | ||
} | ||
|
||
} |
Oops, something went wrong.