d-bl/GroundForge

tell blue from green in pair diagrams

Closed this issue · 6 comments

Very hard for people to tell blue from green in pair diagrams.
4th bullet of https://groups.io/g/GroundForge/message/364,
see also note on color blinds in #197

Related code below. It looks like it only needs a change of the hexadecimal values in the first cited code section and compile it with one of the toJS scripts.

Side note: The code would more stable if availableColors was assigned from colors.keys.filterNot(_.isEmpty)

val colors: Map[String, String] = Map(
"" -> "#000",
"red" -> "#f00",
"blue" -> "#18C",
"green" -> "#080",
"brown" -> "#c90",
"purple" -> "#c3f",
"yellow" -> "#ee0",
"turquoise" -> "#0f9")

private val availableColors = Set("red", "green", "purple", "blue", "brown", "turquoise")

| ${startMarker("red")}
| ${startMarker("blue")}
| ${startMarker("green")}
| ${startMarker("brown")}
| ${startMarker("purple")}
| ${startMarker("yellow")}
| ${startMarker("turquoise")}
| ${endMarker("red")}
| ${endMarker("blue")}
| ${endMarker("green")}
| ${endMarker("brown")}
| ${endMarker("purple")}
| ${endMarker("yellow")}
| ${endMarker("turquoise")}

case (key,value) => s"; marker-$key: url('#$key-$value')"

Test sample

You can play with the inspector of a browser to figure out a pallet. A screenshot from FireFox shows how to change the stroke colors:
image

See also the proposed incomplete set of colors: https://github.com/d-bl/GroundForge#colors

A generated color scheme has a mismatch between turquoise and orange. According to the generator it is not color blind safe either. Looking at the diagrams meant for captions in #205 it is still hard to tell blue from green. Any opinions/suggestions?

image
From https://colorbrewer2.org/#type=qualitative&scheme=Set1&n=7
['#e41a1c','#377eb8','#4daf4a','#984ea3','#ff7f00','#ffff33','#a65628']

"" -> "purple", // default is ctc
"t" -> "",
"ct" -> "green",
"tc" -> "green",
"tct" -> "green",
"ctc" -> "purple",
"ctct" -> "red",
"tctc" -> "red",
"tctct" -> "red",
"ttctc" -> "red",
"ctctt" -> "red",
"cttc" -> "turquoise",
"tcttc" -> "turquoise",
"cttct" -> "turquoise",
"cltc" -> "brown",
"crtc" -> "brown",
"crrc" -> "brown",
"clllc" -> "brown",
"ctttc" -> "brown",
"ctctc" -> "blue",
"ctctct" -> "blue",
"tctctc" -> "blue",
"ctctctc" -> "blue",
"cllcrrcllc" -> "yellow",
"crrcllcrrc" -> "yellow",
"cllcrrcllcrrc" -> "yellow",
"crrcllcrrcllc" -> "yellow",

Obsolete due to the new 4-color per stitch approach. Except for the droste pair diagrams, but these are only kept alive on an as-is basis.