Jump to content
Korean Random
Sign in to follow this  
WarPet

Возможно ли выведение цветов по формату "#........." в отдельный файл.

Recommended Posts

Добрый день, вопрос к опытным пользователям. Будет ли работать через макрос "." подстановка цветов из отдельно созданого файла (например:  "colors2.xc" ). Необходимость возникла в связи с тем что использую не дефолтные цвета команд. Макрос {{c:system}}  отдает цвета в формате "0х.......", а мне нужно в формате "#........." . Суть замысла в "colors2.xc" прописать поля по принципу как в "minimapLabelsData.xc" и добавить в файлах, где будут использоваться цвета из "colors2.xc" - "Colors": ${"colors2.xc":"Colors"}, ну и соответственно в конкретных местах {{.файл в котором используется .Colors. нужное значение}}.

Share this post


Link to post

Short link
Share on other sites
43 минуты назад, Peqpepu сказал:

Макрос {{c:system}}  отдает цвета в формате "0х.......", а мне нужно в формате "#........."

 

Используй:

{{py:replace()}}

Пример:

<font color='{{py:replace('{{.colors.system.ally_alive}}', '0x', '#')}}'></font>

Описание макроса при необходимости в доках найдешь.

Edited by night_dragon_on
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
22 минуты назад, night_dragon_on сказал:

<font color='{{py:replace('{{.colors.system.ally_alive}}', '0x', '#')}}'></font>

только надо с кавычками разобраться.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

создаём свой блок в colors.xc

"mycolors": {
  "ally_alive":    "#96FF00",
  "ally_dead":     "#009900",
  "ally_blowedup": "#007700",
  ...
},
<font color='{{.colors.mycolors.{{sys-color-key}}}}'>
  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...