I was playing around with changing colors in an 8-bit ags-project using something like:
palette[1].r = 60;
palette[1].g = 0;
palette[1].b = 0;
UpdatePalette();
My problem is how can I find the RGB values ags needs, being within that 0-63 range.
For example, the color cyan in paint.net is shown as having rgb values 85,255,255, so that's not within that 0-63 range.
(https://dam1976.home.xs4all.nl/AGS/Image%202.png)
In this 2006 post (https://www.adventuregamestudio.co.uk/forums/index.php?topic=26433.msg334400#msg334400) I noticed an image showing a color from the palette been selected and the rgb values been shown in that 0-63 range.
This is kind-of what I would need:
(http://img.photobucket.com/albums/v54/oversizedchicken/patleteetsdgsdfg.png)
Because the manual shows that:
Quote
UpdatePalette()
Commits the changes you made to the game palette. The script global variable palette[] stores the state of all the colours of the palette. You can access the red, green and blue components with .r, .g and .b. The values range from 0 to 63.
Example:
palette[16].r = 60;
UpdatePalette();
will make the black colour turn bright red. When you actually change the variable, nothing happens. Call this function to update the screen
Sorry, this is part of AGS I don't know very well. (I deleted my previous post)
Thinking logically, if palette colours go 0-63 and correspond to 0-255 you need to take color values from your paint program and convert them from 255-range to 63-range:
COLOR_63 = COLOR_255 * 63 / 255
EDIT: So, Cyan should be something like 21, 62, 62
I'll try that, thank you
Quote from: Crimson Wizard on Wed 24/06/2020 14:42:13
COLOR_63 = COLOR_255 * 63 / 255
Yep, that does the trick. Thank you!