Iโm Ari Stathopoulos, a developer from Greece.
Read my bio on my personal site, where you can also reach me.
Currently working on various projects for Emilia Capital, and contributing to WordPress Core as a sponsored contributor.
A PHP library for color manipulation in themes and plugins
Home Page: http://aristath.github.io/ariColor
License: GNU General Public License v2.0
Iโm Ari Stathopoulos, a developer from Greece.
Read my bio on my personal site, where you can also reach me.
Currently working on various projects for Emilia Capital, and contributing to WordPress Core as a sponsored contributor.
The following formula more closely weights the color components to resemble how the human eye percieves the brightness component of a given color. You might consider using it instead of the current luminance formula:
protected function set_luminance() {
$lum = ( 0.3 * $this->red ) + ( 0.59 * $this->green ) + ( 0.11 * $this->blue );
$this->luminance = round( $lum );
}
Is there any possibility to install this project via composer? Composer says it can't find the package under aristath/ariColor
Thx. Great project btw!
Hi.
You should create releases. This will allow installing the desired version via Composer and will automatically install the latest version if not manually specified.
Right now the only way to install it is to manually add the dev-master
version in composer.json. It does not allow to install the package from command line. I personally prefer to use the CLI.
BTW:
{
"name": "random/project",
"require": {
"aristath/ari-color": "dev-master",
}
}
First, nice plugin! I was looking for something like this for a while.
I'm having a problem with your example to generate a darker color, I created a function:
function category_color_brightness( $color, $amount ) {
// Create a new object using hex as our original color
$color_obj = ariColor::newColor( $color, 'hex' );
// Darken the color by some amount
$result_color = $color_obj->getNew( 'lightness', $color_obj->lightness - $amount );
// return HEX color
return $result_color->hex;
}
The input $color
is: '#505050'
but it always returns: #0-3700-3700-370
.
I tried with the $result_color->toCSS( 'hex' );
but it returns the same thing.
What I'm missing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.