@palett/dye
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -50,2 +50,15 @@ 'use strict'; | ||
/*** | ||
* | ||
* @param {string} hex | ||
* @param {...string} [effects] | ||
* @returns {function(string):string} | ||
*/ | ||
const HexDye = (hex, ...effects) => { | ||
const config = parseEffects(effects); | ||
config.h += utilAnsi.SC + utilAnsi.hexToAnsi(hex), config.t += utilAnsi.SC + utilAnsi.CLR_FORE; | ||
return codedDyer.bind(config); | ||
}; | ||
const PrepDye = function (...effects) { | ||
@@ -69,2 +82,3 @@ const config = parseEffects(effects); | ||
exports.Dye = Dye; | ||
exports.HexDye = HexDye; | ||
exports.PrepDye = PrepDye; |
@@ -1,2 +0,2 @@ | ||
import { brt, Effects, SC, rgbToAnsi, CLR_FORE } from '@palett/util-ansi'; | ||
import { brt, Effects, SC, rgbToAnsi, CLR_FORE, hexToAnsi } from '@palett/util-ansi'; | ||
@@ -46,2 +46,15 @@ /** | ||
/*** | ||
* | ||
* @param {string} hex | ||
* @param {...string} [effects] | ||
* @returns {function(string):string} | ||
*/ | ||
const HexDye = (hex, ...effects) => { | ||
const config = parseEffects(effects); | ||
config.h += SC + hexToAnsi(hex), config.t += SC + CLR_FORE; | ||
return codedDyer.bind(config); | ||
}; | ||
const PrepDye = function (...effects) { | ||
@@ -64,2 +77,2 @@ const config = parseEffects(effects); | ||
export { Dye, PrepDye }; | ||
export { Dye, HexDye, PrepDye }; |
{ | ||
"name": "@palett/dye", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "A colorant to string", | ||
@@ -19,4 +19,4 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"@palett/convert": "^0.3.3", | ||
"@palett/util-ansi": "^0.3.3" | ||
"@palett/convert": "^0.3.4", | ||
"@palett/util-ansi": "^0.3.4" | ||
}, | ||
@@ -41,3 +41,3 @@ "repository": { | ||
"homepage": "https://github.com/hoyeungw/palett/dye#readme", | ||
"gitHead": "db63d69ebb3892d732d3ee75e3a67df46d215dd6" | ||
"gitHead": "ee6fb12b3f4e019bfd76d7c0167307b5e26f77ea" | ||
} |
6332
130
Updated@palett/convert@^0.3.4
Updated@palett/util-ansi@^0.3.4