| author | |
| committer | |
| log | 4e21659b60dc89e43fe00939e60f5d05bb14889e |
| tree | 86d49d2e3c3bf052d7ec25a93228417bacf491f2 |
| parent | c498be6597f316c93ed6b9f0c13838802fb23123 |
1 files changed, 4 insertions(+), 0 deletions(-)
LinearRgb.zig+4| ... | @@ -24,3 +24,7 @@ pub fn initRGBA(r: u8, g: u8, b: u8, a: u8) Self { | ... | @@ -24,3 +24,7 @@ pub fn initRGBA(r: u8, g: u8, b: u8, a: u8) Self { |
| 24 | pub fn eql(x: Self, y: Self) bool { | 24 | pub fn eql(x: Self, y: Self) bool { |
| 25 | return x.r == y.r and x.g == y.g and x.b == y.b; | 25 | return x.r == y.r and x.g == y.g and x.b == y.b; |
| 26 | } | 26 | } |
| 27 | |||
| 28 | pub fn relative_luminance(x: Self) f32 { | ||
| 29 | return (0.2126 * x.r) + (0.7152 * x.g) + (0.0722 * x.b); | ||
| 30 | } |