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

@boenfu/text-rgb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boenfu/text-rgb

Create rgb tuple from a string of text

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

text-rgb

Create rgb tuple from a string of text

Install

npm install @beonfu/text-rgb

Usage

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

Hello World RGB

In addition to the functions of the function itself, I also want to share some interesting content

Hello World
你好世界
हैलो वर्ल्ड
Hola Mundo
Bonjour le monde
مرحبا بالعالم
ওহে বিশ্ব
Привет, мир
Olá Mundo
Halo Dunia
ہیلو دنیا
Hallo Welt
こんにちは世界
안녕 세계
สวัสดีชาวโลก
Saluton mondo

PackageName

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

License

MIT

Keywords

FAQs

Package last updated on 16 Mar 2024

Did you know?

Socket

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.

Install

Related posts

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