承接 umneeq/yii2-color-extractor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

umneeq/yii2-color-extractor

Composer 安装命令:

composer require umneeq/yii2-color-extractor

包简介

Extract colors from an image like a human would do

README 文档

README

Extract colors from an image like a human would do. Based on thephpleague/color-extractor

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist umneeq/yii2-color-extractor "*"

or add

"umneeq/yii2-color-extractor": "*"

to the require section of your composer.json file and run composer update command.

Usage

Notification. This extension accept 3 types of images: jpeg(jpg), png, gif

Once the extension is installed, simply use it in your code by:

use \umneeq\colorextractor\ColorExtractor;

$imagePath = \Yii::getAlias('@frontend/web/img') . DIRECTORY_SEPARATOR . 'test.png';

// Get four most used color hex code
$result = ColorExtractor::extract($imagePath, 4);

// $result
[
    0 => '#F76C0F',
    1 => '#F0C67F',
    2 => '#AABBCC',
    3 => '#CCBBAA',
]

统计信息

  • 总下载量: 1.17k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-11-06