Ultrabrilliant, femtosecond X-ray pulses from X-ray free-electron lasers (XFELs) have promoted the investigation of exotic interactions between intense X-rays and matters, and the observation of minute targets with high spatio-temporal resolution. Although a single X-ray beam has been utilized for these experiments, the use of multiple beams with flexible and optimum beam parameters should drastically enhance the capability and potentiality of XFELs. Here we show a new light source of a two-colour double-pulse (TCDP) XFEL in hard X-rays using variable-gap undulators, which realizes a large and flexible wavelength separation of more than 30% with an ultraprecisely controlled time interval in the attosecond regime. Together with sub-10-fs pulse duration and multi-gigawatt peak powers, the TCDP scheme enables us to elucidate X-ray-induced ultrafast transitions of electronic states and structures, which will significantly contribute to the advancement of ultrafast chemistry, plasma and astronomical physics, and quantum X-ray optics.