Closed richardeakin closed 1 year ago
ColorA( vec4 ) already exists, the analog was missing for 3-channel ColorT class. After this change, code like the following works:
ColorA( vec4 )
ColorT
vec3 col = { 1, 0, 0 }; ci::Color boneColor = col;
Some of my code gets shared with GLSL, so it's nice in some cases to use vec3 instead as an RGB color like you do in shaders, but then for other that use ci::Color, seemlessly convert to what you need. Without, you must do:
vec3
ci::Color
vec3 col = { 1, 0, 0 }; ci::Color boneColor( col.x, col.y, col.z ); // or: ci::Color boneColor = { col.x, col.y, col.z };
However as I first noted, there is already a constructor for the 4-channel version that allows for this:
vec4 col = { 1, 0, 0, 0.5f }; ci::ColorA boneColor = col;
ColorA( vec4 )
already exists, the analog was missing for 3-channelColorT
class. After this change, code like the following works:Some of my code gets shared with GLSL, so it's nice in some cases to use
vec3
instead as an RGB color like you do in shaders, but then for other that useci::Color
, seemlessly convert to what you need. Without, you must do:However as I first noted, there is already a constructor for the 4-channel version that allows for this: