Skip to content

Commit 9d408ce

Browse files
committed
Allow nested colourFuncs throughout
1 parent 2c18cab commit 9d408ce

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/schemas/schema.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,24 +344,24 @@ export interface Glyph {
344344
*/
345345
export interface FunctionFlatten {
346346
func: "flatten";
347-
fg: PositiveInteger | Colourstrings;
348-
bg: PositiveInteger | Colourstrings;
347+
fg: PositiveInteger | Colourstrings | Colourfuncs;
348+
bg: PositiveInteger | Colourstrings | Colourfuncs;
349349
opacity: number;
350350
}
351351
/**
352352
* Chooses the foreground colour with the best contrast against the given background.
353353
*/
354354
export interface FunctionBestContrast {
355355
func: "bestContrast";
356-
bg: PositiveInteger | Colourstrings;
357-
fg: (PositiveInteger | Colourstrings)[];
356+
bg: PositiveInteger | Colourstrings | Colourfuncs;
357+
fg: (PositiveInteger | Colourstrings | Colourfuncs)[];
358358
}
359359
/**
360360
* Lightens or darkens a colour by the specified amount of saturation and luminance. Positive deltas lighten, negative darken.
361361
*/
362362
export interface FunctionLighten {
363363
func: "lighten";
364-
colour: PositiveInteger | Colourstrings;
364+
colour: PositiveInteger | Colourstrings | Colourfuncs;
365365
ds: number;
366366
dl: number;
367367
}

src/schemas/schema.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@
4444
"fg": {
4545
"anyOf": [
4646
{"$ref": "#/$defs/positiveInteger"},
47-
{"$ref": "#/$defs/colourstrings"}
47+
{"$ref": "#/$defs/colourstrings"},
48+
{"$ref": "#/$defs/colourfuncs"}
4849
]
4950
},
5051
"bg": {
5152
"anyOf": [
5253
{"$ref": "#/$defs/positiveInteger"},
53-
{"$ref": "#/$defs/colourstrings"}
54+
{"$ref": "#/$defs/colourstrings"},
55+
{"$ref": "#/$defs/colourfuncs"}
5456
]
5557
},
5658
"opacity": {
@@ -73,7 +75,8 @@
7375
"colour": {
7476
"anyOf": [
7577
{"$ref": "#/$defs/positiveInteger"},
76-
{"$ref": "#/$defs/colourstrings"}
78+
{"$ref": "#/$defs/colourstrings"},
79+
{"$ref": "#/$defs/colourfuncs"}
7780
]
7881
},
7982
"ds": {
@@ -96,15 +99,17 @@
9699
"bg": {
97100
"anyOf": [
98101
{"$ref": "#/$defs/positiveInteger"},
99-
{"$ref": "#/$defs/colourstrings"}
102+
{"$ref": "#/$defs/colourstrings"},
103+
{"$ref": "#/$defs/colourfuncs"}
100104
]
101105
},
102106
"fg": {
103107
"type": "array",
104108
"items": {
105109
"anyOf": [
106110
{"$ref": "#/$defs/positiveInteger"},
107-
{"$ref": "#/$defs/colourstrings"}
111+
{"$ref": "#/$defs/colourstrings"},
112+
{"$ref": "#/$defs/colourfuncs"}
108113
]
109114
}
110115
}

0 commit comments

Comments
 (0)