bash- defining variables with VAR=${[number]:-default}

The variables used in ${1:-8} and ${2:-4} are the positional parameters $1 and $2. These hold the values passed to the script (or shell function) on the command line. If they are not set, the variable substitutions that you mention will use the default values 8 and 4 (respectively) instead.

A script or shell function can take any (?) number of arguments, and these may be had by using $1, $2, ... in the script/function. To get the values of the positional parameters above 9, one need to be write ${10}, ${11} etc.

This could possibly be used in a shell script or in a shell function that takes (at least) two command line arguments, to which you'd like to provide default values if they are not provided.

Another useful variable substitution in this case is ${parameter:?word} which will display word as an error (and exit the script) if parameter is unset:

$ cat script.sh
#!/bin/bash
var1="${1:?Must provide command line argument}"
printf 'I got "%s"\n' "$var1"

$ ./script.sh
script.sh: line 3: 1: Must provide command line argument

$ ./script.sh "Hello world"
I got "Hello world"

It refers to the positional parameters $1 ... $n.

${1:-default} means "if parameter 1 is unset or empty, then use default instead".

Caveat: do not confuse ${1:-2} with ${1: -2}. With bash, the latter is substituted with the last two characters of $1.

Example:

$ set --
$ echo "${1:-2}"
2

$ set 345 678
$ echo "${1:-2}"
345

$ echo "${1: -2}"
45