I painted the gate blue.

Literal

I [topic-は] gate [object-を] paint [with-で] blue-[adverbial-く] painted.

青く is the adverbial form of the い-adjective 青い ('blue'), functioning as a resultative modifier — 'paint so that it becomes blue.' The い-adjective く form + verb is a productive pattern for 'do X so that it becomes Y.' ペンキ is a Dutch loanword (from Dutch pek), one of the many European words that entered Japanese during Dutch trade contacts in the Edo period.