Catppuccin for Java
Be sure to replace the VERSION key below with the version shown above!
<!-- https://mvnrepository.com/artifact/com.catppuccin/catppuccin-palette -->
<dependency>
<groupId>com.catppuccin</groupId>
<artifactId>catppuccin-palette</artifactId>
<version>VERSION</version>
</dependency>
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/com.catppuccin/catppuccin-palette
implementation group: 'com.catppuccin', name: 'catppuccin-palette', version: 'VERSION'
}
If you choose not to use a build tool, pre-built .jar
files are available with every
single release.
package com.catppuccin;
public class Main {
public static void main(String[] args) {
String mocha = Palette.MOCHA.name(); // mocha
String mochaBaseHex = Palette.MOCHA.base().hex(); // 1e1e2e
int[] mochaBaseRGB = Palette.MOCHA.base().components(); // [30, 30, 46]
// loop through just frappé
for (Pair<String, Color> colourPair : Palette.FRAPPE.toList()) {
String name = colourPair.key();
Color colour = colourPair.value();
System.out.println(name + ": " + colour.hex());
}
// loop through every colour
for (Flavour flavour : Palette.toList()) {
System.out.println("Flavour: " + flavour.name());
for (Pair<String, Color> colourPair : flavour.toList()) {
String name = colourPair.key();
Color colour = colourPair.value();
System.out.println(name + ": " + colour.hex());
}
}
}
}
If you are looking to contribute, please read through our CONTRIBUTING.md first!
Copyright © 2023-present Catppuccin Org