mirror of
https://github.com/penpot/penpot.git
synced 2025-07-25 14:57:13 +02:00
🐛 Fix problem when exporting texts with gradients or opacity
This commit is contained in:
parent
bce0e9194c
commit
214c64c49e
7 changed files with 271 additions and 62 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns app.util.color
|
||||
"Color conversion utils."
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.util.object :as obj]
|
||||
[cuerdas.core :as str]
|
||||
[goog.color :as gcolor]))
|
||||
|
@ -155,3 +156,19 @@
|
|||
|
||||
(def empty-color
|
||||
(into {} (map #(vector % nil)) [:color :id :file-id :gradient :opacity]))
|
||||
|
||||
(defn next-rgb
|
||||
"Given a color in rgb returns the next color"
|
||||
[[r g b]]
|
||||
(cond
|
||||
(and (= 255 r) (= 255 g) (= 255 b))
|
||||
(ex/raise "Cannot get next color")
|
||||
|
||||
(and (= 255 g) (= 255 b))
|
||||
[(inc r) 0 0]
|
||||
|
||||
(= 255 b)
|
||||
[r (inc g) 0]
|
||||
|
||||
:else
|
||||
[r g (inc b)]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue