nordtheme/emacs

Theme customization: Custom Comment Brightness

arcticicestudio opened this issue · 2 comments

Introduction

The low contrast color of comments is by design of Nord and has been selected specifically to not disturb code flow and keep the focus of the developer on the code. It is totally fine that users not agree to all highlighting color assignments, everyone has different preferences. That is the reason why themes exist 😄

Anyway, since I've got a bunch of tickets on various port projects with requests to increase the comment contrast I want to make sure the theme is adaptable to fit everyone's needs, even if I'm not going to change the default color.

In most cases the problem can be solved by using local overrides to adjust specific parts of the theme like I proposed in arcticicestudio/nord-vim #26 or arcticicestudio/nord-emacs #23, but providing a official theme customization is the optimal way to achieve this.

Description

A accessibility theme customization should be added to allow users to set the brightness of comments with percentage adjustments from 0% - 20% where 0 is the default nord3 comment color. When a invalid value is passed (< 0 || > 20 || nil) the default nord3 color should be used.

The customization should be available through the nord-comment-brightness variable.

This should be a optional customization to provide a way for users to adjust the color to fit their needs. It should be a port of the reference implementation from the Nord Atom Syntax project. The values should be calculated using the LESSCSS lighten function to ensure full interoperability with other port projects that providing this theme feature.

Increased by Calculated value
0% (default) nord3
1% #4e586d
2% #505b70
3% #525d73
4% #556076
5% #576279
6% #59647c
7% #5b677f
8% #5d6982
9% #5f6c85
10% #616e88
11% #63718b
12% #66738e
13% #687591
14% #6a7894
15% #6d7a96
16% #6f7d98
17% #72809a
18% #75829c
19% #78859e
20% #7b88a1

Usage

Example to increase the comment color brightness by 15%:

(setq nord-comment-brightness 15)

This is really very impressive. Thanks a lot. I want this comment color highlight brightness for a long time. Because there is a issue posted before. but not improved a lot. This time is very good on comment and region (on another issue post). Thanks. REALLY.

@stardiviner Nice to see you like it 😄

I'll merge the PR tomorrow and prepare a new release version.