Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@boenfu/text-rgb
Advanced tools
Create rgb tuple from a string of text
npm install @beonfu/text-rgb
import { rgb, rgbString, rgbaString } from '@beonfu/text-rgb'
rgb('Hello World') // [133, 230, 177]
rgbString('Hello World') // "rgb(133,230,177)"
rgbaString('Hello World', 1) // "rgba(133,230,177,1)"
The principle is to divide the text into three parts, and then take the remainder of 256 after accumulating the sum of charCode So there is no randomness
rgb('Hello World') === rgb('Hello World') // true
In addition to the functions of the function itself, I also want to share some interesting content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Why use @boenfu/text-rgb
instead of text-rgb
?
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/text-rgb - Package name too similar to existing package textrgb; try renaming your package to '@boenfu/text-rgb' and publishing with 'npm publish --access=public' instead
MIT
FAQs
Create rgb tuple from a string of text
The npm package @boenfu/text-rgb receives a total of 1 weekly downloads. As such, @boenfu/text-rgb popularity was classified as not popular.
We found that @boenfu/text-rgb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.