devtodo2 icon indicating copy to clipboard operation
devtodo2 copied to clipboard

Colour customisation

Open Zearin opened this issue 11 years ago • 2 comments

From the README's “Not currently supported” list

Zearin avatar Aug 24 '14 14:08 Zearin

I was thinking about implementing it so that you can change the colors through cmd line arguments, but also specify it in the configuration file. e.g. if it was specified in the configuration file i was thinking something like this format:

{
    "Color" : {
        "Low": {
           "R":230,
           "G": 150,
           "B": 130
        },
	"Medium": {
	    "R": 255,
	    "G":255,
            "B": 85
	}
    }
}

And then i was thinking that if we could check how many terminal colors the persons terminal supported for example 16 or 8, then i would implement a function that found the closest color to the RGB value the person specified, and then rolled with that, and if the terminal supported 255 we could just roll with the RGB value the person wanted. Another version is this one, but just without the support finding the "closest" color which might be too confusing and error prone, it could just default to a sensible color if we could not find the color specified. And the last possibility is to have something like this:

{
    "Color" : {
        "Low": "BLUE",
	"Medium": "BRIGHTGREEN",
       "VERYHIGH":"RED"
    }
}

And then just map enums directly to the ansi escape sequence?

DenLilleMand avatar Apr 03 '17 21:04 DenLilleMand

I think the latter is probably sufficient. As you say, I think the RGB approach is probably a bit complicated.

alecthomas avatar Apr 03 '17 21:04 alecthomas