Skip to content

Commit bdf8ced

Browse files
Css colour Library basic framework and functionality and working test
cases.
1 parent 050b628 commit bdf8ced

File tree

8 files changed

+589
-0
lines changed

8 files changed

+589
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor
2+
composer.phar
3+
composer.lock
4+
.DS_Store

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ css-colors
22
==========
33

44
Takes in a HEX color and produces variations of that colour for the foreground and background
5+
6+
It takes a great php class made by Patrick Fitzgerald in 2004 ( http://www.barelyfitz.com/projects/csscolor/ ) and wraps it in a library for use in your project.

composer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "SoapBox/css-colors",
3+
"description": "Collection of classes for converting and manipulating colors",
4+
"homepage": "https://github.com/SoapBox/css-colors",
5+
"license": "MIT",
6+
"version": "1.0",
7+
"keywords": [
8+
"color","css", "hex", "manipulation", "shading"
9+
],
10+
"authors": [
11+
{
12+
"name": "Graham McCarthy",
13+
"homepage": "http://grahammccarthy.com",
14+
"email": "[email protected]"
15+
}
16+
],
17+
"require": {
18+
"php": ">=5.3.0",
19+
"illuminate/support": "~4.1",
20+
"illuminate/http": "~4.1",
21+
"illuminate/validation": "~4.1"
22+
},
23+
"require-dev": {},
24+
"autoload": {
25+
"psr-0": {
26+
"SoapBox\\Csscolor\\": "src/",
27+
"SoapBox\\Csscolor\\Tests\\": "tests/"
28+
}
29+
},
30+
"minimum-stability": "dev"
31+
}

phpunit.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Package Test Suite">
15+
<directory suffix=".php">./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php namespace SoapBox\Csscolor;
2+
3+
use Illuminate\Support\ServiceProvider;
4+
5+
class CsscolorServiceProvider extends ServiceProvider {
6+
7+
/**
8+
* Indicates if loading of the provider is deferred.
9+
*
10+
* @var bool
11+
*/
12+
protected $defer = false;
13+
14+
/**
15+
* Bootstrap the application events.
16+
*
17+
* @return void
18+
*/
19+
public function boot() {
20+
$this->package('SoapBox/Csscolor');
21+
}
22+
23+
/**
24+
* Register the service provider.
25+
*
26+
* @return void
27+
*/
28+
public function register() {
29+
$this->app['csscolor'] = $this->app->share(function($app) {
30+
return new Csscolor;
31+
});
32+
33+
$this->app->booting(function() {
34+
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
35+
$loader->alias('Csscolor', 'SoapBox\Csscolor\Facade');
36+
});
37+
}
38+
39+
/**
40+
* Get the services provided by the provider.
41+
*
42+
* @return array
43+
*/
44+
public function provides() {
45+
return array('csscolor');
46+
}
47+
48+
}

src/SoapBox/Csscolor/Facade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php namespace SoapBox\Csscolor;
2+
3+
class Facade extends \Illuminate\Support\Facades\Facade {
4+
protected static function getFacadeAccessor() {
5+
return 'csscolor';
6+
}
7+
}

0 commit comments

Comments
 (0)