function _template { source ./templates/variables sed -i "s|{{foreground}}|$foreground|" "$1" sed -i "s|{{foreground_light}}|$foreground_light|" "$1" sed -i "s|{{foreground_lighter}}|$foreground_lighter|" "$1" sed -i "s|{{background}}|$background|" "$1" sed -i "s|{{background_light}}|$background_light|" "$1" sed -i "s|{{background_dark}}|$background_dark|" "$1" sed -i "s|{{background_darker}}|$background_darker|" "$1" sed -i "s|{{cursor_color}}|$cursor_color|" "$1" sed -i "s|{{color0}}|$color0|" "$1" sed -i "s|{{color8}}|$color8|" "$1" sed -i "s|{{color1}}|$color1|" "$1" sed -i "s|{{color9}}|$color9|" "$1" sed -i "s|{{color2}}|$color2|" "$1" sed -i "s|{{color10}}|$color10|" "$1" sed -i "s|{{color3}}|$color3|" "$1" sed -i "s|{{color11}}|$color11|" "$1" sed -i "s|{{color4}}|$color4|" "$1" sed -i "s|{{color12}}|$color12|" "$1" sed -i "s|{{color5}}|$color5|" "$1" sed -i "s|{{color13}}|$color13|" "$1" sed -i "s|{{color6}}|$color6|" "$1" sed -i "s|{{color14}}|$color14|" "$1" sed -i "s|{{color7}}|$color7|" "$1" sed -i "s|{{color15}}|$color15|" "$1" } function _kernel_colors { source ../templates/variables printf "\e[32m==> Generating for kernel arg\e[0m\n" transform_colors () { printf "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" \ "0x$(cut -c "$1" <<< "${color0}")" \ "0x$(cut -c "$1" <<< "${color1}")" \ "0x$(cut -c "$1" <<< "${color2}")" \ "0x$(cut -c "$1" <<< "${color3}")" \ "0x$(cut -c "$1" <<< "${color4}")" \ "0x$(cut -c "$1" <<< "${color5}")" \ "0x$(cut -c "$1" <<< "${color6}")" \ "0x$(cut -c "$1" <<< "${color7}")" \ "0x$(cut -c "$1" <<< "${color8}")" \ "0x$(cut -c "$1" <<< "${color9}")" \ "0x$(cut -c "$1" <<< "${color10}")" \ "0x$(cut -c "$1" <<< "${color11}")" \ "0x$(cut -c "$1" <<< "${color12}")" \ "0x$(cut -c "$1" <<< "${color13}")" \ "0x$(cut -c "$1" <<< "${color14}")" \ "0x$(cut -c "$1" <<< "${color15}")" } printf "vt.default_red=%s vt.default_grn=%s vt.default_blu=%s" "$(transform_colors 1-2)" "$(transform_colors 3-4)" "$(transform_colors 5-6)" }