mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 14:56:13 +02:00
🐛 Fix profile image generation issue.
This commit is contained in:
parent
072e4a4f98
commit
0c53aa158b
2 changed files with 4 additions and 2 deletions
|
@ -11,7 +11,8 @@
|
|||
|
||||
(defn generate*
|
||||
[{:keys [name color size]
|
||||
:or {color "var(--color-black)" size 128}}]
|
||||
:or {color "#000000" size 128}}]
|
||||
|
||||
(let [parts (str/words (str/upper name))
|
||||
letters (if (= 1 (count parts))
|
||||
(ffirst parts)
|
||||
|
@ -27,7 +28,7 @@
|
|||
|
||||
(obj/set! context "font" (str (/ size 2) "px Arial"))
|
||||
(obj/set! context "textAlign" "center")
|
||||
(obj/set! context "fillStyle" "var(--color-white)")
|
||||
(obj/set! context "fillStyle" "#ffffff")
|
||||
(.fillText context letters (/ size 2) (/ size 1.5))
|
||||
|
||||
(.toDataURL canvas)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue