๐Ÿ”ตconvertColors

Convert colors to another format: e.g hex to rgb

Converting Hex colors to RGB colors

convertingColors.js
import { convertColors } from 'the-simplifier'

let convert = async() => {
  let result = await convertColors('HexToRGB', {
    hexCode: '#FFFFFF'
  })

  console.log(result)
}

convert() // Expected: [255, 255, 255]
convertingColors.js
import { convertColors } from 'the-simplifier'

let convert = async() => {
  let result = await convertColors('RGBToHex', {
    rgbCode: [255, 255, 255]
  })

  console.log(result)
}

convert() // Expected: #FFFFFF

Last updated

Was this helpful?