Skip to content

Commit

Permalink
Add edraw-opaque-p and edraw-transparent-p
Browse files Browse the repository at this point in the history
  • Loading branch information
misohena committed Feb 16, 2025
1 parent 7d80ece commit c917403
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions edraw-color.el
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ or greater (returning a list of 3 elements of only RGB)."
(defun edraw-color-equal-p (a b)
(equal a b))

(cl-defmethod edraw-opaque-p ((color edraw-color))
"Return t if COLOR is opaque.
A color is considered opaque if its alpha component is 1 or greater."
(>= (oref color a) 1.0))

(cl-defmethod edraw-transparent-p ((color edraw-color))
"Return t if COLOR is transparent.
A color is considered transparent if its alpha component is 0 or less."
(<= (oref color a) 0.0))

;;;;; Retrieving attributes

(cl-defmethod edraw-hue ((color edraw-color))
Expand Down

0 comments on commit c917403

Please sign in to comment.