Skip to content

Commit

Permalink
🚀 v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa committed Aug 23, 2023
1 parent c61bff6 commit d00c69f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.teamgensouspark.kekkai.color.builder;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;

import io.github.teamgensouspark.kekkai.Kekkai;
Expand All @@ -20,24 +19,15 @@ public ColorMap(int length, KekkaiColor normal) {
public List<Integer> getListRGB() {
int iter_num = (length - 1) / 2;

KekkaiColor ndark = normal.getDarkderColor();
KekkaiColor nlight = normal.getBrighterColor();

List<Integer> result = new ArrayList<>();
List<Integer> dark = new ArrayList<>();
List<Integer> light = new ArrayList<>();
List<Integer> result = Arrays.asList(normal.getRGB());
KekkaiColor darker = normal.getDarkderColor();
KekkaiColor lighter = normal.getBrighterColor();

for (int i = 0; i < iter_num; i++) {
dark.add(ndark.getRGB());
light.add(nlight.getRGB());

ndark = ndark.getDarkderColor();
nlight = nlight.getBrighterColor();
result.add(0, darker.getRGB());
result.add(lighter.getRGB());
}
Collections.reverse(dark);
result.addAll(dark);
result.add(normal.getRGB());
result.addAll(light);

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,33 @@
import java.awt.Color;

public class KekkaiColor {
Color normal;
Color darker;
Color brighter;
private Color normal;
private Color darker;
private Color brighter;

public KekkaiColor(Color color) {
this.normal = color;
this.brighter = color.brighter();
this.darker = color.darker();
}

public KekkaiColor getDarkderColor() {
return KekkaiColor.fromColor(darker);
}

public KekkaiColor getBrighterColor() {
return KekkaiColor.fromColor(brighter);
}
public int getRGB(){

public Integer getRGB() {
return normal.getRGB();
}

public String getHEX() {
Color rgb = new Color(getRGB());
return String.format("#%02X%02X%02X", rgb.getRed(), rgb.getGreen(), rgb.getBlue());
}

public static KekkaiColor fromRGB(int red, int green, int blue) {
return new KekkaiColor(new Color(red, green, blue));
}
Expand All @@ -33,6 +38,10 @@ public static KekkaiColor fromRGB(int color) {
return new KekkaiColor(new Color(color));
}

public static KekkaiColor fromHEX(String color) {
return new KekkaiColor(Color.decode(color));
}

public static KekkaiColor fromColor(Color color) {
return new KekkaiColor(color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.lwjgl.input.Keyboard;

import io.github.teamgensouspark.kekkai.Kekkai;
import io.github.teamgensouspark.kekkai.KekkaiModInfo;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.client.settings.KeyConflictContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@EventBusSubscriber(modid = KekkaiModInfo.MODID)
public class KekkaiSubEntities {
public static final SubEntityType TRACKING = new SubEntityBase<>("tracking_target", TrackingTargetSubEntity.class);
public static final SubEntityType TRACKING = new SubEntityBase<TrackingTargetSubEntity>("tracking_target", TrackingTargetSubEntity.class);

@SubscribeEvent
public static void onSubEntityRegister(RegistryEvent.Register<SubEntityType> event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static <T> Optional<T> asOptional(Option<T> option) {
return DanCoreJavaHelper.optional(option);
}

public static <T> Option<T> optionNone() {
public static <T> Option<T> none() {
return DanCoreJavaHelper.none();
}

Expand Down

0 comments on commit d00c69f

Please sign in to comment.