hgr: mess around with gimp palettes

This commit is contained in:
Vince Weaver 2023-04-17 23:29:20 -04:00
parent d5075e1055
commit 9bcb3dc17e
3 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,53 @@
#include <stdio.h>
#include <math.h>
static int gradient[9][16]={
{0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0},
{1,0,1,0, 0,0,0,0, 0,1,0,1, 0,0,0,0},
{1,0,1,0, 0,1,0,1, 1,0,1,0, 0,1,0,1},
{0,1,0,1, 1,1,1,1, 1,0,1,0, 1,1,1,1},
{1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1},
{2,1,2,1, 1,1,1,1, 1,2,1,2, 1,1,1,1},
{2,1,2,1, 2,1,2,1, 2,1,2,1, 2,1,2,1},
{1,2,1,2, 2,2,2,2, 2,1,2,1, 2,2,2,2},
{2,2,2,2, 2,2,2,2, 2,2,2,2, 2,2,2,2},
};
static int pal_rgb[6][3]={
{0x00,0x00,0x00}, // black
{0x1b,0xcb,0x01}, // green
{0xe4,0x34,0xfe}, // purple
{0xcd,0x5b,0x01}, // orange
{0x1b,0x9a,0xfe}, // blue
{0x00,0x00,0x00}, // white
};
int main(int argc, char **argv) {
int which=4;
int c,x;
int r,g,b;
for(x=0;x<9;x++) {
r=0;
g=0;
b=0;
for(c=0;c<16;c++) {
if (gradient[x][c]==0) {
}
if (gradient[x][c]==1) {
r=r+(pal_rgb[which][0]*pal_rgb[which][0]);
g=g+(pal_rgb[which][1]*pal_rgb[which][1]);
b=b+(pal_rgb[which][2]*pal_rgb[which][2]);
}
if (gradient[x][c]==2) {
r=r+(0xff*0xff);
g=g+(0xff*0xff);
b=b+(0xff*0xff);
}
}
printf("%d %d %d\n",(int)sqrt(r/16.0),(int)sqrt(g/16.0),(int)sqrt(b/16.0));
}
return 0;
}

View File

@ -0,0 +1,21 @@
GIMP Palette
Name: Hires Gradient
Columns: 0
#
0 0 0 Black
102 45 0 Darkest Orange
144 64 0 Dark Orange
177 78 0 LightDark Orange
205 91 1 Orange
218 149 127 Darklight Orange
231 191 180 Light Orange
243 225 220 Lightest Orange
255 255 255 White
13 77 127 Darkest Blue
19 108 179 Dark Blue
23 133 219 Lightdark Blue
27 154 254 Blue
181 210 254 Darlight Blue
221 233 254 Light Blue
221 233 254 Lightest Blue

View File

@ -0,0 +1,20 @@
GIMP Palette
Name: Hires Gradient
Columns: 0
#
0 0 0 Black
102 45 0 Darkest Orange
144 64 0 Dark Orange
177 78 0 LightDark Orange
205 91 1 Orange
218 149 127 Darklight Orange
231 191 180 Light Orange
243 225 220 Lightest Orange
255 255 255 White
13 77 127 Darkest Blue
19 108 179 Dark Blue
23 133 219 Lightdark Blue
27 154 254 Blue
129 184 254 Darlight Blue
181 210 254 Light Blue
221 233 254 Lightest Blue