-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
broke the chart editor again remove latest lime and openfl shit color blind filters (thanks em for the idea) multiple icon fixes clean some code to make things more modular optimize some input maybe
- Loading branch information
1 parent
cd64ce2
commit 4ff479f
Showing
25 changed files
with
695 additions
and
2,144 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; include paths that gets ignored by haxeui (it looks for module.xml files almost everywhere) | ||
; speeds up building time and completion | ||
; you can add your own paths too | ||
|
||
\/kec\/.* | ||
\/hxdiscord_rpc\/.* | ||
\/flixel\/.* | ||
\/flixel-text-input\/.* | ||
\/flixel-addons\.* | ||
\/openfl\/.* | ||
\/hxcpp-debug-server\/.* | ||
\/hxcpp\/.* | ||
\/lime\/.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package kec.backend.util; | ||
|
||
import openfl.filters.ColorMatrixFilter; | ||
import openfl.filters.BitmapFilter; | ||
import haxe.ds.StringMap; | ||
|
||
class FilterUtils | ||
{ | ||
// Mapping filter names to their corresponding matrices | ||
public static var filterMap:StringMap<Array<Float>> = new StringMap(); | ||
|
||
public static function setColorBlindess(num:Int) | ||
{ | ||
if (num == 0) | ||
{ | ||
FlxG.game.setFilters([]); | ||
return; | ||
} | ||
|
||
FlxG.game.setFilters([getFilterByName(Constants.colorFilters[num])]); | ||
} | ||
|
||
public static function initializeFilters() | ||
{ | ||
// Populate the map with filter configurations | ||
filterMap.set("Deuteranopia", [ | ||
0.43, 0.72, -0.15, 0, 0, | ||
0.34, 0.57, 0.09, 0, 0, | ||
-0.02, 0.03, 1, 0, 0, | ||
0, 0, 0, 1, 0, | ||
]); | ||
|
||
filterMap.set("Protanopia", [ | ||
0.20, 0.99, -0.19, 0, 0, | ||
0.16, 0.79, 0.04, 0, 0, | ||
0.01, -0.01, 1, 0, 0, | ||
0, 0, 0, 1, 0, | ||
]); | ||
|
||
filterMap.set("Tritanopia", [ | ||
0.97, 0.11, -0.08, 0, 0, | ||
0.02, 0.82, 0.16, 0, 0, | ||
0.06, 0.88, 0.18, 0, 0, | ||
0, 0, 0, 1, 0, | ||
]); | ||
} | ||
|
||
// Function to get a BitmapFilter from a filter name | ||
public static function getFilterByName(filterName:String):BitmapFilter | ||
{ | ||
if (filterMap.exists(filterName)) | ||
{ | ||
// Retrieve the matrix and create a ColorMatrixFilter | ||
var matrix = filterMap.get(filterName); | ||
return new ColorMatrixFilter(matrix); | ||
} | ||
else | ||
throw "No filter has been applied : " + filterName; | ||
} | ||
} |
Oops, something went wrong.