Código: Seleccionar todo
r1 = (Integer.parseInt(s[0]) * 8) / 256;
g1 = (Integer.parseInt(s[1]) * 8) / 256;
b1 = (Integer.parseInt(s[2]) * 4) / 256;
r2 = (int) r1;
g2 = (int) g1;
b2 = (int) b1;
paleta[numero] = (r2 << 5) | (g2 << 2) | b2;
Código: Seleccionar todo
r1 = (Integer.parseInt(s[0]) * 8) / 256;
g1 = (Integer.parseInt(s[1]) * 8) / 256;
b1 = (Integer.parseInt(s[2]) * 4) / 256;
r2 = (int) r1;
g2 = (int) g1;
b2 = (int) b1;
paleta[numero] = (r2 << 5) | (g2 << 2) | b2;
Zesarux supports Radastan mode as well as Next so his author may provide useful information.
As far as I understood, Radastanus halve the Spectrum display (128x96) whilst pixels may take any colour from a palette of 16 ulaplus colours of your choice.
I did my own research and found these programs that may be useful for you.
Xpal
http://www.smokingun.co.uk/download/xpal34.zip
is a colorpicker to create .pal palettes that you can import into any graphic editor.
You can take a png from the ulaplus wiki, pick one by one 16 different colours and Xpal will make a .pal file.
Irfanview
One way to convert images is the menu "image->import palette" which asks you for a .pal file.
Código: Seleccionar todo
Dim %color8bit = (Round((Gvalue * 7 / 255)) << 5) + (Round((Rvalue * 7 / 255)) << 2) + Round((Bvalue * 3 / 255))
xx = ((color8bit >> 2) BAnd 7) * Floor(255 / 7)
yy = (color8bit >> 5) * Floor(255 / 7)
zz = (color8bit BAnd 3) * Floor(255 / 3)
Código: Seleccionar todo
int convertColorRGBToRadasRGB332( int r, int g, int b ) {
int rr = r & 0xE0;
int gr = ( g & 0xE0 ) >> 3;
int br = ( b & 0xC0 ) >> 6;
return rr | gr | br;
}
Sí, recuerdo un método que se comentó en el hilo de "forzar paleta", pero en el fondo, si fuerzas paleta, entonces lo que ocurre es que tu imagen, de pongamos 26 colores, al pasar a 16 y obligarle a usar colores concretos, se queda hecha un ascohikoki escribió:@Uto
Creo recordar que lo que comentas de Gimp no pasaba con Irfanview. No tengo a mano Irfanview, puedes probar en una imagen lo que comentaba arriba:
menu "image->import palette" y te pedirá un fichero .pal con tus 16 colores radastanianos.