What can be Trademarked
You can indeed protect as a trademark the appeaance of a word, including such things as a particular font and style, and the specific foreground and background colors or color gradients. Many commercial marks include such elements. A famous example is the red on white script version of "Coca-cola" that has been used since the early 1900s.
Color schemes can involve multiple colors or shadings.
See "What is a trademark?" from the US Patent and Trademark Office (USPTO) where it is stated that:
A trademark can be any word, phrase, symbol, design, or a combination of these things that identifies your goods or services. It’s how customers recognize you in the marketplace and distinguish you from your competitors.
...
A trademark:
- Identifies the source of your goods or services.
- Provides legal protection for your brand.
- Helps you guard against counterfeiting and fraud.
Infringement
As for infringement, the rules are much the same as for any trademark, whether of plain text or an image. The prime issue is that there is sufficient similarity that there is a plausible chance that reasonable people would confuse the allegedly infringing mark with the original, or falsely think that the product or service with the allegedly infringing mark was authorized, sponsored, or endorsed by the owner of the original mark, or came from the same source as goods or services identifies with the original mark. Willful passing off is an aggravating factor, but if no reasonable person would be confused, there is no infringement, whatever the would-be imitator may have intended.
As the LII page on the3 LanhamAct says:
To establish a trademark infringement under the Lanham Act for either a registered mark under 15 U.S.C. § 1114, or an unregistered mark under 15 U.S.C. § 1125(a), the plaintiff must demonstrate that (1) the plaintiff has a valid and legally protectable mark; (2) the plaintiff owns the mark; and (3) the defendant's use of the mark to identify goods or services causes a likelihood of confusion. See A&H Sportswear, Inc. v. Victoria's Secret Stores, Inc., 237 F.3d 198 (3rd Cir. 2000)
The A&H Sportswear, Inc. v. Victoria's Secret Stores, Inc., opinion reads:
The critical question in this trademark infringement case, before us for the second time, is whether a typical consumer is likely to confuse MIRACLESUIT swimwear with THE MIRACLE BRA swimwear.
...
During an extensive bench trial, A&H argued that Victoria's Secret should be enjoined from using The Miracle Bra mark for swimwear. Finding a "possibility of confusion," the District Court granted relief to A&H. Following an appeal to this Court that clarified that likelihood of confusion (instead of possibility of confusion) was the correct standard, the District Court concluded that A&H had failed to show by a preponderance of the evidence that Victoria's Secret's The Miracle Bra swimwear mark created a likelihood of either direct or reverse confusion with the Miraclesuit product.
...
We measure federal trademark infringement, 15 U.S.C. S 1114, and federal unfair competition, 15 U.S.C. S 1125(a) (1) (A), by identical standards. See A&H III, 166 F.3d at 202.5 To prove either form of Lanham Act violation, a plaintiff must demonstrate that (1) it has a valid and legally protectable mark; (2) it owns the mark; and (3) the defendant's use of the mark to identify goods or services causes a likelihood of confusion. See Commerce Nat'l Ins. Servs., Inc. v. Commerce Ins. Agency, Inc., 214 F.3d 432, 437 (3d Cir. 2000). The plaintiff bears the burden of proof. See American Home Prods. Corp. v. Barr Labs., Inc., 834 F.2d 368, 371 (3d Cir. 1987).
Non-US law
While the legal details above will be different in different countries, the general principles of trademark law are much the same in most countries. A mark including colored and/or styles text can be protected in every country, so far as I am aware. The "likeihood of confusion" standard and the requirement that a mark be "used in commerce" are also widespread.