Skip to content

Commit

Permalink
Replace :color-name-scheme with :color-syntax-system
Browse files Browse the repository at this point in the history
  • Loading branch information
misohena committed Feb 15, 2025
1 parent 3133fc5 commit 7d80ece
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
10 changes: 4 additions & 6 deletions edraw-color-picker.el
Original file line number Diff line number Diff line change
Expand Up @@ -3279,19 +3279,19 @@ of input changes."
&optional default-syntax-system)
(or
(alist-get :color-syntax-system options)
;; For compatibility (will be removed in the future)
(pcase (alist-get :color-name-scheme options)
('web 'css)
('css 'css)
('emacs 'emacs)
(_ (edraw-color-syntax-system-default
(or default-syntax-system 'emacs))))))
('emacs 'emacs))
(edraw-color-syntax-system-default
(or default-syntax-system 'emacs))))

(defun edraw-color-picker-color-to-string (color options)
"Convert COLOR edraw-color object to string.

Valid OPTIONS are:
(:color-syntax-system . emacs or css)
(:color-name-scheme . emacs or css or web)
(:color-serializer-options . <plist>)
(:color-info-props . <plist>)
(:enable-opacity . nil or t)"
Expand All @@ -3310,7 +3310,6 @@ Valid OPTIONS are:

Valid options are:
(:color-syntax-system . emacs or css)
(:color-name-scheme . emacs or css or web)
(:enable-opacity . nil or t)"
(let ((color-info
(edraw-color-info-from-string
Expand All @@ -3327,7 +3326,6 @@ Valid options are:

Valid options are:
(:color-syntax-system . emacs or css)
(:color-name-scheme . emacs or css or web)
(:enable-opacity . nil or t)"
(car (edraw-color-picker-color-info-from-string string options)))

Expand Down
4 changes: 2 additions & 2 deletions edraw-property-editor.el
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ as a string."
(format "%s: " (edraw-property-editor-property-display-name prop-name))
old-value
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
,@(when-let* ((image-scale (alist-get 'image-scale options)))
(list
Expand All @@ -1260,7 +1260,7 @@ as a string."
(edraw-property-editor-property-display-name prop-name))
old-value
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
;; Preview
,@(list
Expand Down
2 changes: 1 addition & 1 deletion edraw-shape-picker.el
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@
edraw-shape-picker-ui-state
(edraw-ui-state-object-default)))
(options-for-read-color
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
,@(when (and (boundp 'edraw-editor-image-scaling-factor)
edraw-editor-image-scaling-factor)
Expand Down
2 changes: 1 addition & 1 deletion edraw-widget.el
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
nil
old-color
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none"))))

(defun edraw-widget-web-color--choose-action (widget &optional _event)
Expand Down
8 changes: 4 additions & 4 deletions edraw.el
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ document size or view box."
(when (stringp fill)
(when-let* ((color (edraw-color-picker-color-from-string
fill
'((:color-name-scheme . web) (:enable-opacity . t)))))
'((:color-syntax-system . css) (:enable-opacity . t)))))
(>= (edraw-color-a color) 1))))

(edraw-editor-defcmd edraw-set-background ((editor edraw-editor) fill)
Expand All @@ -1729,7 +1729,7 @@ document size or view box."
(edraw-msg "Background Color: ")
(or current-value "")
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
(:on-input-change
. ,(lambda (string color)
Expand Down Expand Up @@ -4540,7 +4540,7 @@ position where the EVENT occurred."
(format "%s %s: " (car tag-value) prop-name)
(cdr tag-value)
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
(:scale-direct . ,(oref editor image-scale))
(:palette-colors . ,(edraw-get-palette-colors editor))
Expand Down Expand Up @@ -6587,7 +6587,7 @@ This function is destructive: the list POINTS is modified."
(format "%s: " prop-name)
(or old-value "")
'("" "none")
`((:color-name-scheme . web)
`((:color-syntax-system . css)
(:no-color . "none")
(:on-input-change
. ,(lambda (string color)
Expand Down

0 comments on commit 7d80ece

Please sign in to comment.