This commit is contained in:
y4my4my4m 2023-05-31 02:51:04 +09:00
parent c947d9d451
commit 2b9a3b0bbb
2 changed files with 16 additions and 10 deletions

View file

@ -148,7 +148,7 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
// color label and text preview // color label and text preview
// TODO: THIS LOGIC DOESNT WORK ON LIGHT THEMES // TODO: THIS LOGIC DOESNT WORK ON LIGHT THEMES
// if color too light or too dark add bg // if color too light or too dark add bg
if (i == 15) if (i == 15)
dc->color = LTGRAY; dc->color = LTGRAY;
else if (gr_palette[i] < gr_palette[15]) else if (gr_palette[i] < gr_palette[15])
@ -159,10 +159,6 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
dc->color = LTRED;*/ dc->color = LTRED;*/
else else
dc->color = 15; dc->color = 15;
// Border for preview box
GrRect(dc, (size * i)-1, c->win_task->pix_height - (size*1.5)-1, size+2, size+2);
if (i == selected_color) if (i == selected_color)
dc->color = 0; dc->color = 0;
@ -170,19 +166,27 @@ U0 DrawCtrlSlider(CDC *dc, CCtrl *c)
GrRect(dc, (size * i), c->win_task->pix_height - (size - size / 2), size, size * 1.5); GrRect(dc, (size * i), c->win_task->pix_height - (size - size / 2), size, size * 1.5);
GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18); GrRect(dc, 6, (size2 * 2) + 65 + 16 * i, 80, 18);
if (i == selected_color) if (i == selected_color)
dc->color = 15; dc->color = 15;
else else
dc->color = i; dc->color = i;
bias = (size / 2) - 4; bias = (size / 2) - 4;
if (i >= 9) if (i >= 9)
bias = (size / 2) - 8; bias = (size / 2) - 8;
GrPrint(dc, bias + (i * size), c->win_task->pix_height - (size * .6) + (size / 4), "%d", i); GrPrint(dc, bias + (i * size), c->win_task->pix_height - (size * .6) + (size / 4), "%d", i);
GrPrint(dc, 10, (size2 * 2) + 70 + 16 * i, "#%d: Test", i); GrPrint(dc, 10, (size2 * 2) + 70 + 16 * i, "#%d: Test", i);
// Border for preview box
GrRect(dc, (size * i)-2, c->win_task->pix_height - (size*1.5)-1, size+2, size+1);
// preview box // preview box
dc->color = i;
GrRect(dc, (size * i), c->win_task->pix_height - (size*1.5), size, size); GrRect(dc, (size * i), c->win_task->pix_height - (size*1.5), size, size);
} }
@ -429,11 +433,11 @@ public U0 PaletteEditor()
current_palette = PaletteSelect; current_palette = PaletteSelect;
break; break;
case 'r': case 'r':
gr_palette[selected_color] = ColorGod(TRUE); gr_palette[selected_color] = ColorGod;
LFBFlush; LFBFlush;
break; break;
case 'R': case 'R':
PaletteGod(FALSE, TRUE); PaletteGod;
break; break;
case CH_CTRLI: case CH_CTRLI:
PopUpOk("\n\n Use the arrows to select color\n\n # to manually input hex value","\n\n\n\t\tMade by y4my4m\n\n"); PopUpOk("\n\n Use the arrows to select color\n\n # to manually input hex value","\n\n\n\t\tMade by y4my4m\n\n");

View file

@ -7,12 +7,14 @@ CBGR24 ColorGod(Bool instant=TRUE)
return GodPick & 0xFFFFFF; return GodPick & 0xFFFFFF;
} }
public U0 PaletteGod(Bool seedUse=TRUE, Bool instant=TRUE) public U0 PaletteGod(Bool seedUse=FALSE, Bool instant=TRUE)
{ {
// Generate a random palette, seed-based or not // Generate a random palette, seed-based or not
I64 i; I64 i;
if (seedUse)
if (seedUse) {
Seed(GodPick); Seed(GodPick);
}
for (i=0; i < 16; i++) for (i=0; i < 16; i++)
gr_palette[i] = ColorGod(instant); gr_palette[i] = ColorGod(instant);
LFBFlush; LFBFlush;