Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@txdfe/at-colors

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@txdfe/at-colors - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

65

lib/generate.js

@@ -8,8 +8,8 @@ "use strict";

var hueStep = 2; // 色相阶梯
var saturationStep = 16; // 饱和度阶梯,浅色部分
var saturationStep2 = 5; // 饱和度阶梯,深色部分
var brightnessStep1 = 5; // 亮度阶梯,浅色部分
var brightnessStep2 = 15; // 亮度阶梯,深色部分
var lightColorCount = 5; // 浅色数量,主色上
var darkColorCount = 4; // 深色数量,主色下
var lightColorCount = 3; // 浅色数量,主色上
var darkColorCount = 3; // 深色数量,主色下
var saturationStep; // 饱和度阶梯,浅色部分
var saturationStep2; // 饱和度阶梯,深色部分
var brightnessStep1; // 亮度阶梯,浅色部分
var brightnessStep2; // 亮度阶梯,深色部分
// 暗色主题颜色映射关系表

@@ -45,2 +45,53 @@ var darkColorMap = [

}
function getStepsValue(hue) {
// 红色
if (hue >= 0 && hue < 24) {
saturationStep = 27;
saturationStep2 = 5;
brightnessStep1 = 13;
brightnessStep2 = 15;
}
// 黄色
if (hue >= 24 && hue < 56) {
saturationStep = 34;
saturationStep2 = 5;
brightnessStep1 = 13;
brightnessStep2 = 15;
}
// 绿色
if (hue >= 56 && hue < 170) {
saturationStep = 20;
saturationStep2 = 5;
brightnessStep1 = 10;
brightnessStep2 = 15;
}
// 浅蓝
if (hue >= 170 && hue < 190) {
saturationStep = 32;
saturationStep2 = 5;
brightnessStep1 = 10;
brightnessStep2 = 15;
}
// 深蓝
if (hue >= 190 && hue < 250) {
saturationStep = 32;
saturationStep2 = 5;
brightnessStep1 = 15;
brightnessStep2 = 15;
}
// 紫色
if (hue >= 250 && hue < 300) {
saturationStep = 40;
saturationStep2 = 5;
brightnessStep1 = 15;
brightnessStep2 = 25;
}
// 粉色
if (hue >= 300 && hue < 360) {
saturationStep = 22;
saturationStep2 = 5;
brightnessStep1 = 13;
brightnessStep2 = 15;
}
}
function getSaturation(hsv, i, light) {

@@ -84,2 +135,4 @@ // grey color don't change saturation

var pColor = tinycolor2_1.default(color);
var pColorHue = pColor.toHsv().h;
getStepsValue(pColorHue);
for (var i = lightColorCount; i > 0; i -= 1) {

@@ -86,0 +139,0 @@ var hsv = pColor.toHsv();

2

package.json
{
"name": "@txdfe/at-colors",
"version": "1.0.0",
"version": "1.0.1",
"description": "Color palettes generator of AT",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc