So I tried placing a white bed using the setblock command, like I did below
/setblock ~ ~ ~ bed 0
I used "0" because that's the data value for a white bed. But this did not work and it only placed half of a red bed. I don't know if this is a bug or what please explain the correct to do this using only command blocks to place a full colored bed in Minecraft 1.12.