Closed mjkalyan closed 2 years ago
I agree it is kind of confusing. Not sure of the best way to solve it.
I assume Raylib means to use "color" as the full color of something and "tint" as mixing in a color. There may be places in the code where I've started using color instead of tint or vice versa, because it was easier for the CLOS hierarchy. We'll need to watch out for and probably fix those.
Beyond that... are there objects in Claylib that could be created with both color and tint? Those I think would be the most confusing ones.
"tint" as mixing in a color
Oh whoops, I was thinking it was opacity or brightness because I had only observed its effects with gray-scale colors :man_facepalming:
It's still a little confusing to have it mean full colour or colour mix depending on context. However, now I'm not as troubled by the current design.
are there objects in Claylib that could be created with both color and tint?
I don't know if we're backed into any corners, but if for some reason we needed to use raylib's DrawText
instead of DrawTextEx
like we do now, then we would be specifying a color
not a tint
. That means we could have both color and tint slots but, practically, I'm not seeing any issues with the current design.
I'll keep an eye out for any cases where we actually need both.
I think I can close this now.
For example, raylib's
ImageDrawTextEx
uses a customFont
object which has its own colour based on the asset, but it also takes atint
for opacity. This works but it's confusing for a user to think of aTEXT
object's%COLOR
slot as doing different things in different contexts (it is the actual colour of the text when usingdraw-object
=DrawTextEx
but a measure of opacity forimage-draw
=ImageDrawTextEx
).It appears to be an inconsistency in Raylib - but we could work around it by adding a %TINT slot.