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

@palett/convert

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@palett/convert - npm Package Compare versions

Comparing version 0.8.8 to 0.8.9

16

dist/index.cjs.js

@@ -159,2 +159,17 @@ 'use strict';

/**
* @param {string} hex
* @returns {number}
*/
function hexToShort(hex) {
let lo = 0,
hi = hex.length;
if (hi === 7) lo++, hi--;
if (hi === 6) return hexAt(hex, lo++) << 8 | hexAt(hex, lo += 2) << 4 | hexAt(hex, lo += 2);
if (hi === 4) lo++, hi--;
if (hi === 3) return hexAt(hex, lo++) << 8 | hexAt(hex, lo++) << 4 | hexAt(hex, lo++);
return 0;
}
/**
*

@@ -229,2 +244,3 @@ * @param {number} n

exports.hexToRgb = hexToRgb;
exports.hexToShort = hexToShort;
exports.hslToHex = hslToHex;

@@ -231,0 +247,0 @@ exports.hslToInt = hslToInt;

17

dist/index.esm.js

@@ -155,2 +155,17 @@ import { round } from '@aryth/math';

/**
* @param {string} hex
* @returns {number}
*/
function hexToShort(hex) {
let lo = 0,
hi = hex.length;
if (hi === 7) lo++, hi--;
if (hi === 6) return hexAt(hex, lo++) << 8 | hexAt(hex, lo += 2) << 4 | hexAt(hex, lo += 2);
if (hi === 4) lo++, hi--;
if (hi === 3) return hexAt(hex, lo++) << 8 | hexAt(hex, lo++) << 4 | hexAt(hex, lo++);
return 0;
}
/**
*

@@ -221,2 +236,2 @@ * @param {number} n

export { Conv, hexToHsl, hexToInt, hexToRgb, hslToHex, hslToInt, hslToRgb, intToHex, intToHsl, intToRgb, rgbToHex, rgbToHsl, rgbToInt };
export { Conv, hexToHsl, hexToInt, hexToRgb, hexToShort, hslToHex, hslToInt, hslToRgb, intToHex, intToHsl, intToRgb, rgbToHex, rgbToHsl, rgbToInt };

4

package.json
{
"name": "@palett/convert",
"version": "0.8.8",
"version": "0.8.9",
"description": "A color converter among RGB, HEX and HSL.",

@@ -44,3 +44,3 @@ "main": "dist/index.cjs.js",

"homepage": "https://github.com/hoyeungw/palett/rgb#readme",
"gitHead": "34b716e675ffe0d0866df519cbfa62a46679f089"
"gitHead": "7175f50132def2e559edbed00883d1e565be5d90"
}
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