Skip to content

catppuccin/java

Repository files navigation

Logo
Catppuccin for Java

Installation

Be sure to replace the VERSION key below with the version shown above!

Maven

<!-- https://mvnrepository.com/artifact/com.catppuccin/catppuccin-palette -->

<dependency>
  <groupId>com.catppuccin</groupId>
  <artifactId>catppuccin-palette</artifactId>
  <version>VERSION</version>
</dependency>

Gradle

repositories {
    mavenCentral()
}

dependencies {
    // https://mvnrepository.com/artifact/com.catppuccin/catppuccin-palette
    implementation group: 'com.catppuccin', name: 'catppuccin-palette', version: 'VERSION'
}

Binaries

If you choose not to use a build tool, pre-built .jar files are available with every single release.

Usage

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());
      }
    }
  }
}

Contributing

If you are looking to contribute, please read through our CONTRIBUTING.md first!

💝 Thanks to

 

Copyright © 2023-present Catppuccin Org