mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 21:17:22 +02:00
✨ Add new palette UI
This commit is contained in:
parent
68c1d9afaf
commit
36b016a37b
83 changed files with 1710 additions and 267 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns app.util.color
|
||||
"Color conversion utils."
|
||||
(:require
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
[app.util.object :as obj]
|
||||
[app.util.strings :as ust]
|
||||
[cuerdas.core :as str]
|
||||
|
@ -129,6 +130,12 @@
|
|||
(str/fmt "linear-gradient(to bottom, %s)" stops-css)
|
||||
(str/fmt "radial-gradient(circle, %s)" stops-css))))
|
||||
|
||||
(defn gradient-type->string [type]
|
||||
(case type
|
||||
:linear (tr "workspace.gradients.linear")
|
||||
:radial (tr "workspace.gradients.radial")
|
||||
nil))
|
||||
|
||||
;; TODO: REMOVE `VALUE` WHEN COLOR IS INTEGRATED
|
||||
(defn color->background [{:keys [color opacity gradient value]}]
|
||||
(let [color (or color value)
|
||||
|
@ -180,3 +187,10 @@
|
|||
|
||||
:else
|
||||
[r g (inc b)]))
|
||||
|
||||
(defn get-color-name
|
||||
[color]
|
||||
(or (:color-library-name color)
|
||||
(:name color)
|
||||
(:color color)
|
||||
(gradient-type->string (:type (:gradient color)))))
|
Loading…
Add table
Add a link
Reference in a new issue