New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bavard/agent-config

Package Overview
Dependencies
Maintainers
2
Versions
316
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bavard/agent-config - npm Package Compare versions

Comparing version 0.1.48-alpha.0 to 0.1.48-alpha.1

4

dist/widget-settings/color-utils.d.ts

@@ -80,7 +80,7 @@ interface IDecomposedColor {

* Lightens a color.
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
* @param {string} colorStr - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
* @param {number} coefficient - multiplier in the range 0 - 1
* @returns {string} A CSS color string. Hex input values are returned as rgb
*/
export declare function lighten(color: string, coefficient: number): string;
export declare function lighten(colorStr: string, coefficient: number): string;
/**

@@ -87,0 +87,0 @@ * Darken or lighten a color, depending on its luminance.

@@ -268,24 +268,28 @@ "use strict";

* Lightens a color.
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
* @param {string} colorStr - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
* @param {number} coefficient - multiplier in the range 0 - 1
* @returns {string} A CSS color string. Hex input values are returned as rgb
*/
function lighten(color, coefficient) {
const { type, values, colorSpace } = decomposeColor(color);
function lighten(colorStr, coefficient) {
const color = decomposeColor(colorStr);
coefficient = clamp(coefficient);
const valuesNumeric = values.map((v) => Number(v));
if (type.indexOf("hsl") !== -1) {
valuesNumeric[2] += (100 - valuesNumeric[2]) * coefficient;
const values = color.values.map((v) => Number(v));
if (color.type.indexOf("hsl") !== -1) {
values[2] += (100 - values[2]) * coefficient;
}
else if (type.indexOf("rgb") !== -1) {
else if (color.type.indexOf("rgb") !== -1) {
for (let i = 0; i < 3; i += 1) {
valuesNumeric[i] += (255 - valuesNumeric[i]) * coefficient;
values[i] += (255 - values[i]) * coefficient;
}
}
else if (type.indexOf("color") !== -1) {
else if (color.type.indexOf("color") !== -1) {
for (let i = 0; i < 3; i += 1) {
valuesNumeric[i] += (1 - valuesNumeric[i]) * coefficient;
values[i] += (1 - values[i]) * coefficient;
}
}
return recomposeColor({ type, values, colorSpace });
return recomposeColor({
type: color.type,
values,
colorSpace: color.colorSpace,
});
}

@@ -292,0 +296,0 @@ exports.lighten = lighten;

{
"name": "@bavard/agent-config",
"version": "0.1.48-alpha.0",
"version": "0.1.48-alpha.1",
"description": "Shared code and single source of truth for Bavard data models.",

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

Sorry, the diff of this file is not supported yet

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