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

seemly

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seemly - npm Package Compare versions

Comparing version 0.1.33 to 0.1.34

14

es/color/index.d.ts

@@ -47,4 +47,14 @@ export declare type RGBA = [number, number, number, number];

export declare function toHslaString(base: HSLA | HSL): string;
export declare function toHexaString(base: RGBA | RGB): string;
export declare function toHexString(base: RGBA | RGB): string;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export declare function toHexaString(base: RGBA | RGB | string): string;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export declare function toHexString(base: RGBA | RGB | string): string;
export { hsl2hsv, hsv2hsl, hsv2rgb, rgb2hsv, rgb2hsl, hsl2rgb } from './convert';

@@ -231,3 +231,24 @@ import colors from './colors';

}
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export function toHexaString(base) {
if (typeof base === 'string') {
let i;
if (i = hexRegex.exec(base)) {
return `${i[0]}FF`;
}
else if (i = hexaRegex.exec(base)) {
return i[0];
}
else if (i = sHexRegex.exec(base)) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}FF`;
}
else if (i = sHexaRegex.exec(base)) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}${i[4]}${i[4]}`;
}
throw new Error(`[seemly/toHexString]: Invalid hex value ${base}.`);
}
const hex = `#${base

@@ -245,3 +266,21 @@ .slice(0, 3)

}
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export function toHexString(base) {
if (typeof base === 'string') {
let i;
if (i = hexRegex.exec(base)) {
return i[0];
}
else if (i = hexaRegex.exec(base)) {
return i[0].slice(0, 7);
}
else if (i = (sHexRegex.exec(base) || sHexaRegex.exec(base))) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}`;
}
throw new Error(`[seemly/toHexString]: Invalid hex value ${base}.`);
}
return `#${base

@@ -248,0 +287,0 @@ .slice(0, 3)

@@ -47,4 +47,14 @@ export declare type RGBA = [number, number, number, number];

export declare function toHslaString(base: HSLA | HSL): string;
export declare function toHexaString(base: RGBA | RGB): string;
export declare function toHexString(base: RGBA | RGB): string;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export declare function toHexaString(base: RGBA | RGB | string): string;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
export declare function toHexString(base: RGBA | RGB | string): string;
export { hsl2hsv, hsv2hsl, hsv2rgb, rgb2hsv, rgb2hsl, hsl2rgb } from './convert';

@@ -252,3 +252,24 @@ "use strict";

exports.toHslaString = toHslaString;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
function toHexaString(base) {
if (typeof base === 'string') {
let i;
if (i = hexRegex.exec(base)) {
return `${i[0]}FF`;
}
else if (i = hexaRegex.exec(base)) {
return i[0];
}
else if (i = sHexRegex.exec(base)) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}FF`;
}
else if (i = sHexaRegex.exec(base)) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}${i[4]}${i[4]}`;
}
throw new Error(`[seemly/toHexString]: Invalid hex value ${base}.`);
}
const hex = `#${base

@@ -267,3 +288,21 @@ .slice(0, 3)

exports.toHexaString = toHexaString;
/**
*
* @param base [255, 255, 255, 255], [255, 255, 255], any hex string
* @returns
*/
function toHexString(base) {
if (typeof base === 'string') {
let i;
if (i = hexRegex.exec(base)) {
return i[0];
}
else if (i = hexaRegex.exec(base)) {
return i[0].slice(0, 7);
}
else if (i = (sHexRegex.exec(base) || sHexaRegex.exec(base))) {
return `#${i[1]}${i[1]}${i[2]}${i[2]}${i[3]}${i[3]}`;
}
throw new Error(`[seemly/toHexString]: Invalid hex value ${base}.`);
}
return `#${base

@@ -270,0 +309,0 @@ .slice(0, 3)

2

package.json
{
"name": "seemly",
"version": "0.1.33",
"version": "0.1.34",
"description": "Utils for user interface.",

@@ -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