Greasy Fork is available in English.

Colourise Hacker News Hierarchy

Applies a pastel colour palette to the the comments hierarchy on Hacker News to make it easier to see which level of comments a comment belongs to

< Feedback on Colourise Hacker News Hierarchy

Review: Good - script works

§
Posted: 13.02.2026

Dev, I really-really-really like this concept and its application:-- I've been using the script since you published it, and I now can no longer read thru HN threads without it!

I got a feature request: I'ld like the 'scaling' of colors to work in reverse ie green, yellow, orange-ish, raspberry (umm, red).

Also I think the [flagged], [dead], [flagged][dead] comments really need to have their own colors. (Is this correct?--they adopt the color of the level above?)

xdpirateAuthor
§
Posted: 13.02.2026
Edited: 13.02.2026

Hi, thanks for your kind review. In order to reverse the order of the colours, you can change the direction the colour wheel is looped through on line 46:

Change:

for(let h = 0; h >= 360; h += 20) {

To:

for(let h = 360; h >= 0; h -= 20) {

Alternatively, you can replace the loop altogether and specify exactly which colours you'd like:

E.g., remove the loop on lines 46-50, and replace the array on line 45 with your desired colours:

let colours = [`hsl(20, 100%, 85%)`, `hsl(40, 100%, 85%)`, `hsl(60, 100%, 85%)`, `hsl(300, 100%, 85%)`] // etc

Use any CSS colour notation. You can have as many custom colours you'd like, I suggest at least 10 if you want to make sure the deepest nested comments get coloured.

When it comes to flagged/dead comments, could you link a thread where these exist so I can have a look? If I remember correctly, flagged comments should get the same colours as their siblings.

§
Posted: 13.02.2026

Thanks for the quick response!

Change:

for(let h = 0; h >= 360; h += 20) {

To:

for(let h = 360; h >= 0; h -= 20) {

(Using https://news.ycombinator.com/item?id=40543196 for test.)

This didn't work--or rather it works exactly the way you described i.e. it reverses the direction of the colorwheel.

So I'll have to use the custom colors method. Which is best for my scenario, as I want a color-aid to suggest 'This chain has gone on long enough, Stop reading it!'.


When it comes to flagged/dead comments, could you link a thread where these exist so I can have a look? If I remember correctly, flagged comments should get the same colours as their siblings.

I was & am not certain, so I'm sure it works as you designed it.

What I'm really looking for is a way to custom-color those types of comments. Is it possible to do within the current script design?

xdpirateAuthor
§
Posted: 13.02.2026

I'm sure it can be done, I'll keep an eye out for flagged comments and see what I can do.

Post reply

Sign in to post a reply.