class
CrShader::TresReader
- CrShader::TresReader
- Reference
- Object
Overview
Reader and Serializer for Godot 4 ColorPalette .tres resources Operates directly on ColorPalette schemas containing PackedColorArray.
Defined in:
crshader/parser/tres_reader.crConstant Summary
-
COLOR_REGEX =
/Color\(\s*([-\d.eE]+)\s*,\s*([-\d.eE]+)\s*,\s*([-\d.eE]+)(?:\s*,\s*([-\d.eE]+))?\s*\)/
Class Method Summary
-
.parse_string(content : String) : TresData
Parses Godot 4 ColorPalette text resource (.tres) Extracts the PackedColorArray with type safety
-
.read(path : String, base_dir : String | Nil = nil) : TresData | Nil
Reads ColorPalette .tres resource
-
.resolve_path(path : String, base_dir : String | Nil = nil) : String | Nil
Resolves a Godot res:// or relative path to an existing filesystem path
-
.write_color_palette(path : String, colors : Array(Tuple(Float32, Float32, Float32, Float32))) : Bool
Writes a Godot 4 ColorPalette .tres resource
Class Method Detail
Parses Godot 4 ColorPalette text resource (.tres) Extracts the PackedColorArray with type safety
Reads ColorPalette .tres resource
def self.resolve_path(path : String, base_dir : String | Nil = nil) : String | Nil
#
Resolves a Godot res:// or relative path to an existing filesystem path
def self.write_color_palette(path : String, colors : Array(Tuple(Float32, Float32, Float32, Float32))) : Bool
#
Writes a Godot 4 ColorPalette .tres resource