package bonsai-rt:color

⌘K
Ctrl+K
or
/

    Types

    ColorRampNode ¶

    ColorRampNode :: struct($T: typeid) {
    	… // See source for fields
    }

    LinearRGBAColor ¶

    LinearRGBAColor :: distinct [4]f64
     

    4 component Color in the linear srgb space this means no gamma correction has been applied

    Related Procedures With Parameters
    Related Procedures With Returns

    LinearRGBAU8Color ¶

    LinearRGBAU8Color :: distinct [4]u8
     

    4 component Color in the linear srgb space this means no gamma correction has been applied each component as a u8

    Related Procedures With Parameters

    LinearRGBColor ¶

    LinearRGBColor :: distinct [3]f64
     

    3 component Color in the linear srgb space this means no gamma correction has been applied

    Related Procedures With Parameters
    Related Procedures With Returns

    LinearRGBU8Color ¶

    LinearRGBU8Color :: distinct [3]u8
     

    3 component Color in the linear srgb space this means no gamma correction has been applied each component as a u8

    Related Procedures With Parameters

    SPolyColor ¶

    SPolyColor :: distinct [3]f64
    Related Procedures With Parameters
    Related Procedures With Returns

    SRGBAColor ¶

    SRGBAColor :: distinct [4]f64
     

    4 component Color in the srgb space with gamma correction applied

    Related Procedures With Parameters
    Related Procedures With Returns

    SRGBAU8Color ¶

    SRGBAU8Color :: distinct [4]u8
     

    4 component Color in the srgb space with gamma correction applied each component as a u8

    Related Procedures With Parameters
    Related Procedures With Returns

    SRGBColor ¶

    SRGBColor :: distinct [3]f64
     

    3 component Color in the srgb space with gamma correction applied

    Related Procedures With Parameters
    Related Procedures With Returns

    SRGBU8Color ¶

    SRGBU8Color :: distinct [3]u8
     

    3 component Color in the srgb space with gamma correction applied each component as a u8

    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    WAVE_LENGTH_MAX ¶

    WAVE_LENGTH_MAX :: 830

    WAVE_LENGTH_MIN ¶

    WAVE_LENGTH_MIN :: 360

    Variables

    D65_WHITEPOINT_FUNCTION_STARTING_AT_300NM ¶

    D65_WHITEPOINT_FUNCTION_STARTING_AT_300NM: [531]f64 = …

    XYZ_COLOR_MATCH_FUNCTIONS_STARTING_AT_360NM ¶

    XYZ_COLOR_MATCH_FUNCTIONS_STARTING_AT_360NM: [471][3]f64 = …

    Procedures

    alpha_transparency_over ¶

    alpha_transparency_over :: proc(above: LinearRGBAColor, below: LinearRGBAColor) -> LinearRGBAColor {…}
     

    alpha transparency over operator

    approximate_d65_whitepoint_function ¶

    approximate_d65_whitepoint_function :: proc(l: f64) -> f64 {…}

    approximate_spoly_color_test ¶

    approximate_spoly_color_test :: proc(t: ^testing.T) {…}

    approximate_spoly_to_xyz_d65 ¶

    approximate_spoly_to_xyz_d65 :: proc(p: SPolyColor) -> XYZColor {…}
     

    a version of spoly_to_xyz_d65 that uses gaussian approximations of the color match functions and whitepoint

    approximate_xyz_color_matching_function ¶

    approximate_xyz_color_matching_function :: proc(l: f64) -> (f64, f64, f64) {…}

    approximate_xyz_d65_to_spoly ¶

    approximate_xyz_d65_to_spoly :: proc(xyz: XYZColor) -> (SPolyColor, f64) {…}
     

    a version of xyz_d65_to_spoly that uses gaussian approximations of the color match functions and whitepoint

    d65_whitepoint_function ¶

    d65_whitepoint_function :: proc(l: f64) -> f64 {…}

    eval_color_ramp ¶

    eval_color_ramp :: proc(color_ramp: []ColorRampNode($T), t: f64) -> $T {…}

    gamma_correction ¶

    gamma_correction :: proc(c: f64) -> f64 {…}

    gaussian_fn ¶

    gaussian_fn :: proc(x: f64, u: f64, t1: f64, t2: f64) -> f64 {…}

    inverse_gamma_correction ¶

    inverse_gamma_correction :: proc(v: f64) -> f64 {…}

    linear_rgb_to_srgb ¶

    linear_rgb_to_srgb :: proc(rgb_linear: LinearRGBColor) -> SRGBColor {…}

    linear_rgb_to_xyz ¶

    linear_rgb_to_xyz :: proc(linear_rgb: LinearRGBColor) -> XYZColor {…}

    linear_rgba_to_srgba ¶

    linear_rgba_to_srgba :: proc(rgb_linear: LinearRGBAColor) -> SRGBAColor {…}

    linear_rgbau8_to_linear_rgba ¶

    linear_rgbau8_to_linear_rgba :: proc(linear_rgba_u8: LinearRGBAU8Color) -> LinearRGBAColor {…}

    linear_rgbu8_to_linear_rgba ¶

    linear_rgbu8_to_linear_rgba :: proc(linear_rgb_u8: LinearRGBU8Color) -> LinearRGBColor {…}

    sigmoid ¶

    sigmoid :: proc(x: f64) -> f64 {…}

    sigmoid_derivative ¶

    sigmoid_derivative :: proc(x: f64) -> f64 {…}

    sigmoid_polynomial ¶

    sigmoid_polynomial :: proc(l: f64, p: [3]f64) -> f64 {…}

    sigmoid_polynomial_derivatives ¶

    sigmoid_polynomial_derivatives :: proc(l: f64, p: [3]f64) -> [3]f64 {…}

    spoly_color_test ¶

    spoly_color_test :: proc(t: ^testing.T) {…}

    spoly_to_xyz_d65 ¶

    spoly_to_xyz_d65 :: proc(p: SPolyColor) -> XYZColor {…}
     

    returns the xyz color output if a light with d65 spectrum is shone upon a surface with the spoly color

    srgb_to_linear_rgb ¶

    srgb_to_linear_rgb :: proc(srgb: SRGBColor) -> LinearRGBColor {…}

    srgb_to_srgbu8 ¶

    srgb_to_srgbu8 :: proc(srgb: SRGBColor) -> SRGBU8Color {…}

    srgb_to_xyz ¶

    srgb_to_xyz :: proc(srgb: SRGBColor) -> XYZColor {…}

    srgba_to_linear_rgba ¶

    srgba_to_linear_rgba :: proc(srgb: SRGBAColor) -> LinearRGBAColor {…}

    srgba_to_srgbau8 ¶

    srgba_to_srgbau8 :: proc(srgb: SRGBAColor) -> SRGBAU8Color {…}

    srgbau8_from_hex ¶

    srgbau8_from_hex :: proc(hex: u32) -> SRGBAU8Color {…}

    srgbau8_to_srgba ¶

    srgbau8_to_srgba :: proc(srgba_u8: SRGBAU8Color) -> SRGBAColor {…}

    srgbu8_from_hex ¶

    srgbu8_from_hex :: proc(hex: u32) -> SRGBU8Color {…}

    srgbu8_to_srgb ¶

    srgbu8_to_srgb :: proc(srgb_u8: SRGBU8Color) -> SRGBColor {…}

    xyz_color_matching_function ¶

    xyz_color_matching_function :: proc(l: f64) -> (f64, f64, f64) {…}

    xyz_d65_to_spoly ¶

    xyz_d65_to_spoly :: proc(xyz: XYZColor) -> (SPolyColor, f64) {…}
     

    the inverse of spoly_to_xyz_d65

    xyz_to_linear_rgb ¶

    xyz_to_linear_rgb :: proc(xyz: XYZColor) -> LinearRGBColor {…}

    xyz_to_srgb ¶

    xyz_to_srgb :: proc(xyz: XYZColor) -> SRGBColor {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2025-04 (vendor "odin") Linux_amd64 @ 2025-05-13 09:15:52.882742034 +0000 UTC