Skip to main content

toRgb

Transforms Hex code into RGB Array (or) RGB String. This makes it easy to convert from discord.js v13 to v14.

Program

const simplydjs = require("simply-djs");
simplydjs.toRgb('hex code')
INFO

This can be implemented anywhere. Even outside of discord.js ;)

Arguments:

simplydjs.toRgb(
hex: string,
type: 'Array' | 'String'
)
  • hex: #string | string
  • type: Array | String

Returns:

  • <Array> (or) <string>
// Hex code: #FFFFFF
[255, 255, 255]
// or
'rgb(255, 255, 255)'