Skip to main content

toRgb

Transforms Hex code into RGB Array.

Implementation

simplydjs.toRgb('hex code')

Types

simplydjs.toRgb(hex: string): ColorResolvable

Returns


Example

rgb.js
const simplydjs = require('simply-djs')

simplydjs.toRgb('#406dbc')
// [64, 109, 188]

simplydjs.toRgb('#f0f0f0')
// [240, 240, 240]