From 7fc0f95ceba74e1fa2143b55baefdc5d315ed0c7 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 27 Mar 2024 22:16:37 +0100 Subject: [PATCH] Consistent Nextflow Greens --- src/content/blog/2024/nextflow-colored-logs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/blog/2024/nextflow-colored-logs.md b/src/content/blog/2024/nextflow-colored-logs.md index d8d72baa..dec035de 100644 --- a/src/content/blog/2024/nextflow-colored-logs.md +++ b/src/content/blog/2024/nextflow-colored-logs.md @@ -46,7 +46,7 @@ The console output shown by Nextflow describes a range of information. Much of i With some judicious use of the `dim` style, we can make less important information fade into the background. For example, the "stem" of the fully qualified process identifiers now step back to allow the process name to stand out. Secondary information such as the number of tasks that were cached, or the executor that is being submitted to, are still there to see but take a back seat. Doing the reverse with some `bold` text helps to highlight the run name – key information for identifying and resuming pipeline runs. Using color allows different fields to be easily distinguished, such as process labels and task hashes. Greens, blues, and reds in the task statuses allow a reader to get an impression of the run progress without needing to read every number. -Probably the most difficult aspect technically was the `NEXTFLOW` header line. I knew I wanted to use the "Nextflow Green" here, or as close to it as possible. But colors in the terminal are tricky. What the ANSI standard defines as `green`, `black`, and `blue` can vary significantly across different systems and terminal themes. Some people use a light color scheme and others run in dark mode. This hadn’t mattered much for most of the colors up until this point - I could use the [Jansi](https://github.com/fusesource/jansi) library to use named colors and they should look ok. But for the specific RGB of the _"Nextflow Green"_ I had to [hardcode specific ANSI control characters](https://github.com/nextflow-io/nextflow/blob/c9c7032c2e34132cf721ffabfea09d893adf3761/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy#L379-L389). But it got worse - it turns out that the default Terminal app that ships with macOS only supports 256 colors, so I had to find the closest match (_"light sea green"_ if you’re curious). Even once the green was ok, using `black` as the text color meant that it would actually render as white with some terminal color themes and be unreadable. In the end, the header text is a very dark gray. +Probably the most difficult aspect technically was the `NEXTFLOW` header line. I knew I wanted to use the _"Nextflow Green"_ here, or as close to it as possible. But colors in the terminal are tricky. What the ANSI standard defines as `green`, `black`, and `blue` can vary significantly across different systems and terminal themes. Some people use a light color scheme and others run in dark mode. This hadn’t mattered much for most of the colors up until this point - I could use the [Jansi](https://github.com/fusesource/jansi) library to use named colors and they should look ok. But for the specific RGB of the _"Nextflow Green"_ I had to [hardcode specific ANSI control characters](https://github.com/nextflow-io/nextflow/blob/c9c7032c2e34132cf721ffabfea09d893adf3761/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy#L379-L389). But it got worse - it turns out that the default Terminal app that ships with macOS only supports 256 colors, so I had to find the closest match (_"light sea green"_ if you’re curious). Even once the green was ok, using `black` as the text color meant that it would actually render as white with some terminal color themes and be unreadable. In the end, the header text is a very dark gray.
Testing many horrible terminal themes