mirror of
https://github.com/catppuccin/java.git
synced 2026-03-09 00:08:30 +08:00
docs: other classes
This commit is contained in:
parent
079a937117
commit
a7a7b755d1
@ -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(),
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user