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) Supports both native Godot 4 flat
PackedColorArray(r, g, b, a, ...)and legacyColor(r, g, b, a)entries. -
.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 using Godot 4's native flat PackedColorArray(r, g, b, a, ...) format
Class Method Detail
Parses Godot 4 ColorPalette text resource (.tres)
Supports both native Godot 4 flat PackedColorArray(r, g, b, a, ...) and legacy Color(r, g, b, a) entries.
Reads ColorPalette .tres resource
Resolves a Godot res:// or relative path to an existing filesystem path
Writes a Godot 4 ColorPalette .tres resource using Godot 4's native flat PackedColorArray(r, g, b, a, ...) format