Access to "corrected" player chat color.

Things that already exist in the current mod API
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Access to "corrected" player chat color.

Post by eradicator »

Since chat color is now edited for better contrast it's no longer possible to print chat messages in the player color via lua. I tried default/red/green and they all produce different color output.

Code: Select all

hi!
/c game.print('eradicator: hi!', game.player.color)
Here's an example picture chat vs command:
color.png
color.png (48.96 KiB) Viewed 1643 times
As i'd also like to show the player name in custom GUIs it would be nice to have access to the "corrected" color, either via player.high_contrast_color or via exposing the correction in e.g. util.fix_chat_color.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.


User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Access to "corrected" player chat color.

Post by eradicator »

Hrrng...please wait while i grab a shovel to dig a hole.
Thanks.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Already exists”