tint

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tint provides structures and utilities for Echo VR tint assets.

Tints are cosmetic color schemes applied to player chassis. They consist of multiple color values (RGBA floats) that are stored within CR15NetRewardItemCS component data, not as separate asset files.

Based on Ghidra analysis of echovr.exe: - Tint registration: CR15NetRewardItemCS_RegisterTint @ 0x140cf23c0 - Tint override: R15NetCustomization_OverrideTint @ 0x140d20710 - Binary search: CSymbolTable_BinarySearch @ 0x140c682f0

Global tint tables at runtime: - g_TintTable_ItemIDs @ 0x1420d3ac0 (primary lookup by resourceID) - g_TintTable_Secondary @ 0x1420d3ac8 (secondary tint values) - g_TintTable_Tertiary @ 0x1420d3ad0 (tertiary tint values)

Index

Constants

View Source
const TintEntrySize = 0x60

TintEntrySize is the size of a TintEntry in bytes (0x60 = 96).

View Source
const TintTableEntryPrimarySize = 0x18

TintTableEntryPrimarySize is the size of a primary table entry (0x18 = 24).

View Source
const TintTableEntrySecondarySize = 0x20

TintTableEntrySecondarySize is the size of a secondary table entry (0x20 = 32).

Variables

View Source
var KnownTints = map[uint64]string{
	0x0bf4c0e4d2eaa06c: "rwd_tint_s2_a_default",
	0x19b3ed5723fadbda: "orange_tint_tab_seen",
	0x19f7bd5fef66c280: "pattern_tint_0",
	0x1c73d6d8e28c446e: "pattern_tint_100",
	0x3e474b60a9416aca: "rwd_tint_s1_a_default",
	0x43ac219540f9df74: "rwd_tint_s1_b_default",
	0x5d468c4263c586b8: "rwd_tint_s2_c_default",
	0x68f507c6186e4c1e: "rwd_tint_s1_c_default",
	0x69466570d92546d2: "layer2_albedo_tint_color",
	0x6f14fe299a8f9c02: "blue_tint_tab_seen",
	0x74d228d09dc5dc80: "rwd_tint_0006",
	0x74d228d09dc5dc81: "rwd_tint_0007",
	0x74d228d09dc5dc82: "rwd_tint_0004",
	0x74d228d09dc5dc83: "rwd_tint_0005",
	0x74d228d09dc5dc84: "rwd_tint_0002",
	0x74d228d09dc5dc85: "rwd_tint_0003",
	0x74d228d09dc5dc86: "rwd_tint_0000",
	0x74d228d09dc5dc87: "rwd_tint_0001",
	0x74d228d09dc5dc8e: "rwd_tint_0008",
	0x74d228d09dc5dc8f: "rwd_tint_0009",
	0x74d228d09dc5dd80: "rwd_tint_0016",
	0x74d228d09dc5dd81: "rwd_tint_0017",
	0x74d228d09dc5dd82: "rwd_tint_0014",
	0x74d228d09dc5dd83: "rwd_tint_0015",
	0x74d228d09dc5dd84: "rwd_tint_0012",
	0x74d228d09dc5dd85: "rwd_tint_0013",
	0x74d228d09dc5dd86: "rwd_tint_0010",
	0x74d228d09dc5dd87: "rwd_tint_0011",
	0x74d228d09dc5dd8e: "rwd_tint_0018",
	0x74d228d09dc5dd8f: "rwd_tint_0019",
	0x74d228d09dc5de80: "rwd_tint_0026",
	0x74d228d09dc5de81: "rwd_tint_0027",
	0x74d228d09dc5de82: "rwd_tint_0024",
	0x74d228d09dc5de83: "rwd_tint_0025",
	0x74d228d09dc5de84: "rwd_tint_0022",
	0x74d228d09dc5de85: "rwd_tint_0023",
	0x74d228d09dc5de86: "rwd_tint_0020",
	0x74d228d09dc5de87: "rwd_tint_0021",
	0x74d228d09dc5de8e: "rwd_tint_0028",
	0x74d228d09dc5de8f: "rwd_tint_0029",
	0x761faa113b5215d2: "rwd_tint_s2_b_default",
	0x80b08485fb665a7a: "layer1_albedo_tint_color",
	0xa11587a1254c9502: "rwd_tint_s3_tint_d",
	0xa11587a1254c9503: "rwd_tint_s3_tint_e",
	0xa11587a1254c9504: "rwd_tint_s3_tint_b",
	0xa11587a1254c9505: "rwd_tint_s3_tint_c",
	0xa11587a1254c9507: "rwd_tint_s3_tint_a",
	0xb87af47e9388b408: "rwd_tint_s1_d_default",
}

KnownTints maps Symbol64 hashes to tint names (from nakama server data).

Functions

func LookupTintName

func LookupTintName(symbol uint64) string

LookupTintName returns the name for a tint Symbol64, or empty string if unknown.

Types

type Color

type Color struct {
	R, G, B, A float32
}

Color represents an RGBA color with float32 components (0.0-1.0).

func ColorFromBytes

func ColorFromBytes(data []byte) Color

ColorFromBytes reads a Color from 16 bytes (4 float32s in little-endian).

func (Color) CSS

func (c Color) CSS() string

CSS returns the color as a CSS rgba() string.

func (Color) Hex

func (c Color) Hex() string

Hex returns the color as a hex string (#RRGGBBAA).

func (Color) String

func (c Color) String() string

String returns a human-readable color representation.

func (Color) ToBytes

func (c Color) ToBytes() []byte

ToBytes writes a Color to 16 bytes (4 float32s in little-endian).

type TintEntry

type TintEntry struct {
	ResourceID uint64   // Symbol64 hash identifying this tint
	Colors     [5]Color // 5 RGBA color values
	Reserved   [8]byte  // Reserved/padding bytes
}

TintEntry represents a tint item as stored in CR15NetRewardItemCS component. Each entry is 0x60 (96) bytes containing: - Symbol64 resourceID at offset 0 (8 bytes) - 5 color blocks of 16 bytes each (80 bytes total) - 8 bytes padding/reserved

The 5 color blocks (originally thought to be 6) represent tint colors.

func ReadTintEntry

func ReadTintEntry(r io.Reader) (*TintEntry, error)

ReadTintEntry reads a TintEntry from binary data.

func TintEntryFromBytes

func TintEntryFromBytes(data []byte) *TintEntry

TintEntryFromBytes parses a TintEntry from 96 bytes.

func (*TintEntry) String

func (e *TintEntry) String() string

String returns a human-readable representation of the tint entry.

func (*TintEntry) ToBytes

func (e *TintEntry) ToBytes() []byte

ToBytes serializes a TintEntry to 96 bytes.

func (*TintEntry) ToCSS

func (e *TintEntry) ToCSS(name string) string

ToCSS generates CSS custom properties for this tint entry. The name parameter is used as the prefix for the CSS variables.

type TintTableEntry_Primary

type TintTableEntry_Primary struct {
	ResourceID uint64 // Symbol64 hash for lookup
	ItemData   uint64 // Pointer to source data (runtime only)
	ItemIndex  uint32 // Index in reward item array
	Padding    uint32 // Alignment padding
}

TintTableEntry_Primary represents an entry in g_TintTable_ItemIDs (0x18 bytes). Used for binary search lookup by resourceID.

type TintTableEntry_Secondary

type TintTableEntry_Secondary struct {
	TintValue  uint64 // Tint color value or Symbol64
	ResourceID uint64 // Symbol64 hash
	ItemData   uint64 // Pointer to source data (runtime only)
	Flags      uint64 // Flags or metadata
}

TintTableEntry_Secondary represents an entry in g_TintTable_Secondary/Tertiary (0x20 bytes).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL