nobiot / org-remark

Highlight & annotate text, EWW, Info, and EPUB
https://nobiot.github.io/org-remark/
GNU General Public License v3.0
425 stars 20 forks source link

Matching highlights with active theme #52

Closed nobiot closed 1 year ago

nobiot commented 1 year ago

Original: https://github.com/nobiot/org-transclusion/issues/158

@oatmealm, I believe the issue is relevant with Org-remark.

nobiot commented 1 year ago

Alternatively, you can do something like the following to define a face that has different colors depending on light or dark themes.

I think I will add this in the manual.

(defface org-remark-highlighter-yellow
  '((((class color) (min-colors 88) (background light))
     :underline "#d0bc00" :background "goldenrod1")
    (((class color) (min-colors 88) (background dark))
     :underline "#d0bc00" :background "DarkGoldenrod4")
    (t
     :inherit highlight))
  "Face for the yellow highlighter pen.")

(org-remark-create "yellow"
                   'org-remark-highlighter-yellow
                   '(CATEGORY "important"))

The result looks like this:

image

image

oatmealm commented 1 year ago

Amazing. I'll try it asap.

oatmealm commented 1 year ago

Ok, so I'm using the defface as suggested with modus-vivendi/operandi... it seems like the background is overriden by the theme or something else is happening.

describe-face on a highlighted region:

There are 3 overlays here:
 From 8462 to 8937
  *org-remark-note-body [Show]
  CATEGORY             "important"
  face                 (:inherit default :underline "gold2")
  help-echo            [Show]
  org-remark-id        "c84bd647"
  org-remark-label     "yellow"
 From 8462 to 8937
  *org-remark-note-body [Show]
  CATEGORY             "important"
  face                 (:inherit default :underline "gold2")
  help-echo            [Show]
  org-remark-id        "c84bd647"
  org-remark-label     "yellow"
 From 8535 to 8597
  face                 hl-line
  priority             -50
  window               nil

Though if I run describe-face directly, I'm seeing this:

Face: org-remark-highlighter-yellow (sample) (customize this face)

Documentation:
Face for the yellow highlighter pen.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: unspecified
DistantForeground: unspecified
       Background: goldenrod1
        Underline: #d0bc00
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: unspecified
          Inherit: unspecified

Screenshot from 2023-01-11 14-14-56 Screenshot from 2023-01-11 14-14-47

nobiot commented 1 year ago

I think default also defines background. You might need to put your custom defface before default to the pen face list (or after; I forgot which takes precedence).

nobiot commented 1 year ago

With the code example above, I get this in describe-text-properties

image

Yours looks different: face (:inherit default :underline "gold2")

How do you create a pen?

I did this; add the defined face in the second argument as a symbol.

(org-remark-create "yellow"
                   'org-remark-highlighter-yellow
                   '(CATEGORY "important"))
oatmealm commented 1 year ago

I believe I'm using the default/builtin yellow pen, no?

nobiot commented 1 year ago

Oh i see. I am sorry for the confusion. I have removed the background color from the default because it is extremely difficult for me to decide what color makes the foreground legible in every case.

please override the default with the named face of your choice.

If you have a suggestion of colors I should use for the default, please let me know; i will gladly take it.

oatmealm commented 1 year ago

Well, the default picked up by these two themes seems to work for me now... as far as I can tell...

Screenshot from 2023-01-12 16-43-26 Screenshot from 2023-01-12 16-47-34

oatmealm commented 1 year ago

OT... :) aren't you on Mastodon somwhere? There's @emacs.ch in case you're looking for a home ....

nobiot commented 1 year ago

No. I was not a heavy user of TW and will continue to keep my social media consumption minimal.

I am considering implementing a ActivePub-enabled microblog on VPS at some point this year…

nobiot commented 1 year ago

I assume this issue can be close (?)