Skip to content

Commit 685c028

Browse files
authored
Merge pull request #3134 from kikora/codex/fix-color-picker-incorrect-colors-issue
Align graftegner fill/line palette roles
2 parents 181e596 + 6019bac commit 685c028

12 files changed

Lines changed: 119 additions & 119 deletions

File tree

brøkfigurer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ function isValidColor(value) {
341341
const PALETTE_PAIR_COUNT = 6;
342342
const PALETTE_SLOT_COUNT = PALETTE_PAIR_COUNT * 2;
343343
const FILL_COLOR_COUNT = PALETTE_PAIR_COUNT;
344-
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
345-
{ fillIndex: 5, lineIndex: 4 },
346-
{ fillIndex: 7, lineIndex: 6 },
347-
{ fillIndex: 9, lineIndex: 8 },
348-
{ fillIndex: 10, lineIndex: 11 },
349-
{ fillIndex: 12, lineIndex: 13 },
350-
{ fillIndex: 14, lineIndex: 15 }
351-
];
344+
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
345+
{ fillIndex: 0, lineIndex: 1 },
346+
{ fillIndex: 2, lineIndex: 3 },
347+
{ fillIndex: 4, lineIndex: 5 },
348+
{ fillIndex: 6, lineIndex: 7 },
349+
{ fillIndex: 8, lineIndex: 9 },
350+
{ fillIndex: 10, lineIndex: 11 }
351+
];
352352
const colorPickerHelper = getColorPickerHelper();
353353
const colorPickerModule = getColorPickerModule();
354354
const fillColorPickerInstances = new WeakMap();

brøkpizza.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ const LEGACY_PIZZA_COLORS = {
138138
const SHARED_GROUP_ID = 'graftegner';
139139
const FILL_COLOR_COUNT = 6;
140140
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
141-
{ fillIndex: 5, lineIndex: 4 },
142-
{ fillIndex: 7, lineIndex: 6 },
143-
{ fillIndex: 9, lineIndex: 8 },
144-
{ fillIndex: 10, lineIndex: 11 },
145-
{ fillIndex: 12, lineIndex: 13 },
146-
{ fillIndex: 14, lineIndex: 15 }
141+
{ fillIndex: 0, lineIndex: 1 },
142+
{ fillIndex: 2, lineIndex: 3 },
143+
{ fillIndex: 4, lineIndex: 5 },
144+
{ fillIndex: 6, lineIndex: 7 },
145+
{ fillIndex: 8, lineIndex: 9 },
146+
{ fillIndex: 10, lineIndex: 11 }
147147
];
148148
const colorPickerHelper = getColorPickerHelper();
149149
const colorPickerModule = getColorPickerModule();

diagram.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const PIE_LABEL_POSITIONS = ['outside', 'inside'];
3232
const SERIES_COLOR_OPTION_COUNT = 6;
3333
const DIAGRAM_FILL_COLOR_COUNT = 6;
3434
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
35-
{ fillIndex: 5, lineIndex: 4 },
36-
{ fillIndex: 7, lineIndex: 6 },
37-
{ fillIndex: 9, lineIndex: 8 },
38-
{ fillIndex: 10, lineIndex: 11 },
39-
{ fillIndex: 12, lineIndex: 13 },
40-
{ fillIndex: 14, lineIndex: 15 }
35+
{ fillIndex: 0, lineIndex: 1 },
36+
{ fillIndex: 2, lineIndex: 3 },
37+
{ fillIndex: 4, lineIndex: 5 },
38+
{ fillIndex: 6, lineIndex: 7 },
39+
{ fillIndex: 8, lineIndex: 9 },
40+
{ fillIndex: 10, lineIndex: 11 }
4141
];
4242
const colorPickerHelper = getColorPickerHelper();
4343
const colorPickerModule = getColorPickerModule();

graftegner.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ function getColorPickerModule() {
358358
}
359359

360360
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
361-
{ fillIndex: 5, lineIndex: 4 },
362-
{ fillIndex: 7, lineIndex: 6 },
363-
{ fillIndex: 9, lineIndex: 8 },
364-
{ fillIndex: 10, lineIndex: 11 },
365-
{ fillIndex: 12, lineIndex: 13 },
366-
{ fillIndex: 14, lineIndex: 15 }
361+
{ fillIndex: 0, lineIndex: 1 },
362+
{ fillIndex: 2, lineIndex: 3 },
363+
{ fillIndex: 4, lineIndex: 5 },
364+
{ fillIndex: 6, lineIndex: 7 },
365+
{ fillIndex: 8, lineIndex: 9 },
366+
{ fillIndex: 10, lineIndex: 11 }
367367
];
368368
const colorPickerHelper = getColorPickerHelper();
369369
const colorPickerModule = getColorPickerModule();

kvikkbilder.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
};
6767
let activeFillColorIndex = 1;
6868
const DEFAULT_GRAFTEGNER_COLOR_ROLES = [
69-
{ fillIndex: 5, lineIndex: 4 },
70-
{ fillIndex: 7, lineIndex: 6 },
71-
{ fillIndex: 9, lineIndex: 8 },
72-
{ fillIndex: 10, lineIndex: 11 },
73-
{ fillIndex: 12, lineIndex: 13 },
74-
{ fillIndex: 14, lineIndex: 15 }
69+
{ fillIndex: 0, lineIndex: 1 },
70+
{ fillIndex: 2, lineIndex: 3 },
71+
{ fillIndex: 4, lineIndex: 5 },
72+
{ fillIndex: 6, lineIndex: 7 },
73+
{ fillIndex: 8, lineIndex: 9 },
74+
{ fillIndex: 10, lineIndex: 11 }
7575
];
7676
const colorPickerHelper = getColorPickerHelper();
7777
const colorPickerModule = getColorPickerModule();

packages/palette/dist/index.cjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ const RAW_COLOR_SLOT_GROUPS = [
6969
description:
7070
'Farger som brukes av graftegner, diagram, brøksirkler, brøkfigurer, tallfigurer, kvikkbilder, tenkeblokker, brøkvegg og 3D-figurer.',
7171
slots: [
72-
{ index: 5, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
73-
{ index: 4, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
74-
{ index: 7, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
75-
{ index: 6, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
76-
{ index: 9, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
77-
{ index: 8, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
78-
{ index: 10, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
79-
{ index: 11, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
80-
{ index: 12, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
81-
{ index: 13, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
82-
{ index: 14, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
83-
{ index: 15, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
72+
{ index: 0, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
73+
{ index: 1, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
74+
{ index: 2, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
75+
{ index: 3, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
76+
{ index: 4, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
77+
{ index: 5, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
78+
{ index: 6, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
79+
{ index: 7, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
80+
{ index: 8, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
81+
{ index: 9, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
82+
{ index: 10, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
83+
{ index: 11, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
8484
]
8585
},
8686
{

packages/palette/dist/index.global.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/palette/dist/index.js

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/palette/src/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ const RAW_COLOR_SLOT_GROUPS = [
6767
description:
6868
'Farger som brukes av graftegner, diagram, brøksirkler, brøkfigurer, tallfigurer, kvikkbilder, tenkeblokker, brøkvegg og 3D-figurer.',
6969
slots: [
70-
{ index: 5, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
71-
{ index: 4, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
72-
{ index: 7, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
73-
{ index: 6, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
74-
{ index: 9, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
75-
{ index: 8, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
76-
{ index: 10, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
77-
{ index: 11, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
78-
{ index: 12, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
79-
{ index: 13, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
80-
{ index: 14, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
81-
{ index: 15, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
70+
{ index: 0, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
71+
{ index: 1, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
72+
{ index: 2, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
73+
{ index: 3, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
74+
{ index: 4, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
75+
{ index: 5, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
76+
{ index: 6, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
77+
{ index: 7, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
78+
{ index: 8, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
79+
{ index: 9, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
80+
{ index: 10, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
81+
{ index: 11, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
8282
]
8383
},
8484
{

palette/palette-config.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,26 @@ function buildLegacyPaletteConfig() {
169169
description:
170170
'Farger som brukes av graftegner, diagram, brøksirkler, brøkfigurer, tallfigurer, kvikkbilder, tenkeblokker, brøkvegg og 3D-figurer.',
171171
colorRoles: [
172-
{ fillIndex: 5, lineIndex: 4 },
173-
{ fillIndex: 7, lineIndex: 6 },
174-
{ fillIndex: 9, lineIndex: 8 },
175-
{ fillIndex: 10, lineIndex: 11 },
176-
{ fillIndex: 12, lineIndex: 13 },
177-
{ fillIndex: 14, lineIndex: 15 }
172+
{ fillIndex: 0, lineIndex: 1 },
173+
{ fillIndex: 2, lineIndex: 3 },
174+
{ fillIndex: 4, lineIndex: 5 },
175+
{ fillIndex: 6, lineIndex: 7 },
176+
{ fillIndex: 8, lineIndex: 9 },
177+
{ fillIndex: 10, lineIndex: 11 }
178178
],
179179
slots: [
180-
{ index: 5, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
181-
{ index: 4, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
182-
{ index: 7, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
183-
{ index: 6, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
184-
{ index: 9, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
185-
{ index: 8, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
186-
{ index: 10, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
187-
{ index: 11, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
188-
{ index: 12, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
189-
{ index: 13, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
190-
{ index: 14, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
191-
{ index: 15, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
180+
{ index: 0, label: 'Fyll 1', description: 'Fyllfarge til linje 1.' },
181+
{ index: 1, label: 'Linje 1', description: 'Linjefarge til fyll 1.' },
182+
{ index: 2, label: 'Fyll 2', description: 'Fyllfarge til linje 2.' },
183+
{ index: 3, label: 'Linje 2', description: 'Linjefarge til fyll 2.' },
184+
{ index: 4, label: 'Fyll 3', description: 'Fyllfarge til linje 3.' },
185+
{ index: 5, label: 'Linje 3', description: 'Linjefarge til fyll 3.' },
186+
{ index: 6, label: 'Fyll 4', description: 'Fyllfarge til linje 4.' },
187+
{ index: 7, label: 'Linje 4', description: 'Linjefarge til fyll 4.' },
188+
{ index: 8, label: 'Fyll 5', description: 'Fyllfarge til linje 5.' },
189+
{ index: 9, label: 'Linje 5', description: 'Linjefarge til fyll 5.' },
190+
{ index: 10, label: 'Fyll 6', description: 'Fyllfarge til linje 6.' },
191+
{ index: 11, label: 'Linje 6', description: 'Linjefarge til fyll 6.' }
192192
]
193193
},
194194
{

0 commit comments

Comments
 (0)