diff options
| author | tslil clingman <> | 2021-09-22 22:46:47 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2021-09-22 22:59:31 -0400 |
| commit | 9d25e1d69dede7d79ca9115a4ce4e65af49b8ddc (patch) | |
| tree | abb39414cfa08e09a0abb63a8a1809c39d790a11 /src/sfml/graphics | |
| parent | a657cc828cdcbb07f460d53f78a12dfe00a57325 (diff) | |
Colour blending
Some amount of work went into finding appropriate integer arithmetic
formulae that were reasonably accurate. At this point i've settled for
the incorrect-but-faster version. The better-though-slower formulas
are still there in case i change my mind.
It would help to have an assumption such as, but not limited to, the
surfaces are always going to be fully opaque.
Diffstat (limited to 'src/sfml/graphics')
| -rw-r--r-- | src/sfml/graphics/color.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sfml/graphics/color.zig b/src/sfml/graphics/color.zig index d6aa850..5555c22 100644 --- a/src/sfml/graphics/color.zig +++ b/src/sfml/graphics/color.zig @@ -55,7 +55,7 @@ pub const Color = packed struct { } /// Creates a color with rgba floats from 0 to 1 - fn fromFloats(red: f32, green: f32, blue: f32, alpha: f32) Color { + pub fn fromFloats(red: f32, green: f32, blue: f32, alpha: f32) Color { return Color{ .r = @floatToInt(u8, math.clamp(red, 0.0, 1.0) * 255.0), .g = @floatToInt(u8, math.clamp(green, 0.0, 1.0) * 255.0), |
