foyyay/colorcast 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

foyyay/colorcast

Composer 安装命令:

composer create-project foyyay/colorcast

包简介

Get tints and shades based on configuration data and a color hue.

README 文档

README

Given a configuration of hue points to named saturation and value entries you can provide a hue and the saturation and value will be interpolated and the resulting color returned as a hex string.

Install

composer require foyyay/colorcast;

Use

use Foyyay\ColorCast\ColorCast;

$caster = new ColorCast(config);
$colors = $caster->fromHue(90);
// or
$colors = $caster->fromColor('#87d936');

An example config could look like:

$config = [
    "0" => [
        "primary" => ["saturation" => 80, "value" => 70],
        "accent" => ["saturation" => 75, "value" => 85],
    ],
    "20" => [
        "primary" => ["saturation" => 40, "value" => 50],
        "accent" => ["saturation" => 80, "value" => 90],
    ],
];

So given a hue of 90 the you'll get back an array with two keys, "primary", and "accent". The hue for both colors will be 90, the saturation for primary will be 60 and the value will be 60.

You may add as many hue values from 0 to < 360 as you want. You can add as many named configs as you want.

Thank you.

Bootstrapped using the Composer Library Template.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固