Although what is a Pascal's triangle is well-known and we already can generate it, the task is now different:
Output \$n\$ first lines of the Pascal's triangle as colored bricks.
Color number is computed as maximal power of \$d\$, that divides the needed-to-color element or \$7\$ if power is more than \$7\$.
Numbered colors are (\$0\$-based): default, red, green, yellow, blue, magenta, cyan, white (default color is 0th, red is 1st, .. white is 7th).
- Any space-filling (I mean not
.
,'
or"
or smth small) character
can be used for bricks, even'\u2588'
. - Whitespace before or after the bricks are optional.
- Brick horizontal length (\$1\$ or \$2\$) is your choice.
- You may choose any convenient output method -- ansi text or graphics or HTML or whatever
- If you choose output letters or color numbers instead of coloring the triangle itself, you should specify in the text of your answer which character corresponds to which color, but output wouldn't look so nice)
Input Integers \$n\$ and \$d>1\$ in any convenient method.
This is code-golf, the shortest code in each language wins.