Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-3d

Source of release 0.9.2

0.9.2 / src / core / material.lucb

from luce_gpu import gpu
import errors

pub type Color = gpu.Color

pub interface Material:
    func color() -> Color
    func is_lit() -> bool

pub func check_color(color: Color) -> !:
    if not (color.red >= 0.0 and color.red <= 1.0 and color.green >= 0.0 and color.green <= 1.0 and color.blue >= 0.0 and color.blue <= 1.0):
        error(errors.invalid, "material and light colors must be finite linear RGB in 0..1")