Globally the text color can be changed using style
ImGuiStyle* style = &ImGui::GetStyle();
style->Colors[ImGuiCol_Text] = ImVec4(1.0f, 1.0f, 1.0f, 1.00f);
Color of a single widget alone can be changed by push/pop styles
char txt_green[] = "text green";
char txt_def[] = "text default";
// Particular widget styling
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0,255,0,255));
ImGui::InputText("##text1", txt_green, sizeof(txt_green));
ImGui::PopStyleColor();
...
// Use global style colors
ImGui::InputText("##text2", txt_def, sizeof(txt_def));
Output:
Again if you want separate colors for input text and label i would suggest to go with two widgets easily.
char txt_def[] = "text default";
ImGui::InputText("##Name", txt_def, sizeof(txt_def));
ImGui::SameLine();
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255));
ImGui::Text("Name");
ImGui::PopStyleColor();