import { colorsService } from 'services' ; param { Record < string , unknown > } colors returns { Record < string , unknown > } example export function schemeToTerminalRgb ( colors ) { const { hexToRgb } = colorsService ( ) ; const terminalColors = Object . entries ( colors ) . reduce ( ( acc , current ) => { const [ key , color ] = current ; const [ red , green , blue ] = hexToRgb ( String ( color ) ) ; Object . assign ( acc , { [ `${ key }_red` ] : Number . parseFloat ( String ( red ) ) / 255 , [ `${ key }_green` ] : Number . parseFloat ( String ( green ) ) / 255 , [ `${ key }_blue` ] : Number . parseFloat ( String ( blue ) ) / 255 , } ) ; return acc ; } , { } ) ; return terminalColors ; }