Chat colours: add lime, cyan, indigo, brown and grey
Thirteen colours in hue order. Each has a light and a dark shade checked by the existing contrast test; teal moves a shade deeper so it stays apart from cyan on light surfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,11 +4,16 @@ const chatColorNames = [
|
||||
'red',
|
||||
'orange',
|
||||
'amber',
|
||||
'lime',
|
||||
'green',
|
||||
'teal',
|
||||
'cyan',
|
||||
'blue',
|
||||
'indigo',
|
||||
'purple',
|
||||
'pink',
|
||||
'brown',
|
||||
'grey',
|
||||
];
|
||||
|
||||
/// The session's highlight name, or null when it has none (or one this
|
||||
|
||||
@@ -13,16 +13,25 @@ Color? chatColorShade(BuildContext context, String? name) {
|
||||
'red' => Colors.red,
|
||||
'orange' => Colors.orange,
|
||||
'amber' => Colors.amber,
|
||||
'lime' => Colors.lime,
|
||||
'green' => Colors.green,
|
||||
'teal' => Colors.teal,
|
||||
'cyan' => Colors.cyan,
|
||||
'blue' => Colors.blue,
|
||||
'indigo' => Colors.indigo,
|
||||
'purple' => Colors.purple,
|
||||
'brown' => Colors.brown,
|
||||
'grey' => Colors.blueGrey,
|
||||
_ => Colors.pink,
|
||||
};
|
||||
if (dark) return swatch.shade300;
|
||||
return switch (name) {
|
||||
'orange' || 'amber' => swatch.shade800,
|
||||
'red' || 'teal' || 'purple' || 'pink' => swatch.shade600,
|
||||
'lime' => swatch.shade900,
|
||||
// Teal leans green and cyan leans blue, so the two stay apart on light.
|
||||
'teal' || 'orange' || 'amber' => swatch.shade800,
|
||||
'cyan' => swatch.shade700,
|
||||
'red' || 'purple' || 'pink' || 'grey' => swatch.shade600,
|
||||
'indigo' || 'brown' => swatch.shade500,
|
||||
_ => swatch.shade700,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,6 +67,6 @@ void main() {
|
||||
expect(chatSessionColor({'color': '#ff0000'}), isNull);
|
||||
expect(chatSessionColor({}), isNull);
|
||||
expect(chatSessionColor(null), isNull);
|
||||
expect(chatColorNames, hasLength(8));
|
||||
expect(chatColorNames, hasLength(13));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ type ChatExportFile struct {
|
||||
}
|
||||
|
||||
// ChatColors is the fixed palette of chat highlight names, in picker order.
|
||||
var ChatColors = []string{"red", "orange", "amber", "green", "teal", "blue", "purple", "pink"}
|
||||
var ChatColors = []string{"red", "orange", "amber", "lime", "green", "teal", "cyan", "blue", "indigo", "purple", "pink", "brown", "grey"}
|
||||
|
||||
// ValidChatColor reports whether name is one of ChatColors.
|
||||
func ValidChatColor(name string) bool {
|
||||
|
||||
Reference in New Issue
Block a user