定制 vikin/laricon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vikin/laricon

Composer 安装命令:

composer require vikin/laricon

包简介

Generate awesome and unique identicons with beautiful colors

README 文档

README

Laricon is a library which generate an identicon image based on a string.

Here is some examples of awesome results!

Identicon example #1   Identicon example #2   Identicon example #3   Identicon example #4   Identicon example #5

Installation

composer require vikin/laricon

Usage

Images are generated in PNG format with transparent background.

The string can be an email, an IP address, a username, an ID or something else.

Generate an identicon

Add in the config/app.php file

'providers' => [
    ....
    Vikin\Laricon\Providers\LariconServiceProvider::class
],

'aliases' => [
    ....
    'Laricon' => Vikin\Laricon\Facades\Laricon::class
]

Then you can generate and display an identicon image

Laricon::displayImage('vikin');

or generate and get the image data

Laricon::getImageData('vikin');

or generate and get the base 64 image uri ready for integrate into an HTML img tag.

Laricon::getImageDataUri('vikin');
<img src="{{ Laricon::getImageDataUri('vikin') }}" alt="Vikin Identicon" />

Change the size

By default the size will be 64 pixels. If you want to change the image size just add a secondary parameter. 512 x 512px in this example.

Laricon::displayImage('vikin', 512);

Color

The color is automatically generated according to the string hash but you can chose to specify a color by adding a third argument.

Color can be an hexadecimal with 6 characters

Laricon::displayImage('vikin', 64, 'A87EDF');

or an array with red, green, blue value

Laricon::displayImage('foo', 64, [200, 100, 150]);

That's it!

License

Identicon is released under the MIT License. See the bundled LICENSE file for details.

From the yzalis/Identicon

统计信息

  • 总下载量: 660
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固