docs: other classes

This commit is contained in:
nullishamy 2024-05-18 02:46:47 +01:00
parent 079a937117
commit a7a7b755d1
No known key found for this signature in database
2 changed files with 42 additions and 0 deletions

View File

@ -1,32 +1,56 @@
package com.catppuccin;
/**
* This class provides utility methods to provide different representations of the RGB color data.
*/
public class Color {
private final int r;
private final int g;
private final int b;
/**
* Generate a Color based on the provided RGB values
* @param r the red value
* @param b the green value
* @param g the blue value
*/
public Color(int r, int b, int g) {
this.r = r;
this.g = g;
this.b = b;
}
/**
* @return the red component
*/
public int r() {
return this.r;
}
/**
* @return the green component
*/
public int g() {
return this.g;
}
/**
* @return the blue component
*/
public int b() {
return this.b;
}
/**
* @return the color, as a hex string
*/
public String hex() {
return String.format("%02x%02x%02x", this.r(), this.g(), this.b());
}
/**
* @return the components of the color as a 3 element array
*/
public int[] components() {
return new int[]{
r(),

View File

@ -3,12 +3,30 @@ package com.catppuccin;
import java.util.ArrayList;
import java.util.List;
/**
* This class represents the entirety of the Catppuccin v0.2.0 palette.
*/
@GeneratedPalette(target="com.catppuccin.BuiltinPalettes")
public class Palette
{
/**
* Mocha flavoured Catppuccin
*/
public static final Flavor MOCHA = com.catppuccin.BuiltinPalettes.MOCHA;
/**
* Macchiato flavoured Catppuccin
*/
public static final Flavor MACCHIATO = com.catppuccin.BuiltinPalettes.MACCHIATO;
/**
* Frappe flavoured Catppuccin
*/
public static final Flavor FRAPPE = com.catppuccin.BuiltinPalettes.FRAPPE;
/**
* Latte flavoured Catppuccin
*/
public static final Flavor LATTE = com.catppuccin.BuiltinPalettes.LATTE;
public List<Flavor> toList() {