Looking for the core Riskrieg repository? Find it here.
This repository hosts the code for the color palette portion of the project. It also contains the current definition of the RKP file format.
Maven
<dependency>
<groupId>com.riskrieg</groupId>
<artifactId>palette</artifactId>
<version>VERSION</version>
</dependency>
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("com.riskrieg:palette:VERSION")
}
First, to understand the RKP file format, you need to know what an RkpColor
is:
An RkpColor
consists of the following:
- A 32-bit signed integer
order
that defines the relative ordering of the color. - A name string, encoded to UTF-8.
- A 32-bit signed integer
r
, representing the red channel of the color. Valid values between 0-255 inclusive, on either end. - A 32-bit signed integer
g
, representing the green channel of the color. Valid values between 0-255 inclusive, on either end. - A 32-bit signed integer
b
, representing the blue channel of the color. Valid values between 0-255 inclusive, on either end. - Alpha channels are explicitly and purposefully unsupported at this time.
The RKP file format is a simple JSON format that contains the following:
- A name string, encoded to UTF-8.
- Six
RkpColor
objects that define static element colors of map images, such as text color, border color, territory color, land color, water color, and connection color. Order and name do not matter for these colors, so theorder
element should be set to-1
, and thename
element should be set to"Unnamed"
. - A sorted set of
RkpColor
objects, with a size of between 2 and 16. Theorder
element of eachRkpColor
object in the set should be immediately sequential.
This all comes together to form the RkpPalette
object. You can find a Java implementation of an encoder and decoder in the codec repository.
All RKP files should have the .rkp
file extension.
While this is not currently a binary file format, it could easily be made into one, and may be in the future.
Join our Discord server: Riskrieg Discord
The code in this repository is licensed under the MIT license.