How to change color of HA bulb with lambda syntax?

Currently I’m able to turn on/off/toggle HA bulb within ESPHome using lambda syntax

                HomeassistantServiceResponse svc;
                svc.service = "light.toggle";

                HomeassistantServiceMap ent;
                ent.key = "entity_id";
                ent.value = "light.test";
                svc.data.push_back(ent);
                global_api_server->send_homeassistant_service_call(svc);

I would like to be able to change the color of the bulb, any idea how to do this with lambda syntax?

Why use a lambda when the ability is there in the native API? Native API Component — ESPHome

because i have a very complex logic and using yaml format is just unreadable.