Giter Site home page Giter Site logo

aricolor's Introduction

Hi there ๐Ÿ‘‹

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.

aricolor's People

Contributors

aristath avatar sammyjo20 avatar yarri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aricolor's Issues

Suggestion: Use alternate luminance calculation

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 );
}

Source: W3C: Checkpoint 2.2 - Ensure that foreground and background color combinations provide sufficient contrast when viewed by someone having color deficits or when viewed on a black and white screen

Composer support

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!

Create releases

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",
    }
}

Wrong return

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.