.attheme editor blog – Telegram
.attheme editor blog
86 subscribers
16 photos
18 links
.attheme editor is a powerful editor of Android Telegram themes running in the browser. This channel has news on updates and some tips on using the editor.

Contact the author: @snejugal
Also developer: @AlexStrNik

attheme-editor.snejugal.ru
Download Telegram
Sadly, the wallpaper went away, so you should skip chat_wallpaper when iterating over all variables if you have an image. But we think you should change the wallpaper too with shifted color with the same rate — at least, Adobe Photoshop definetely can definetely do that, but many other photo editors should support it too.

Unfortunately, we don't have API for managing the wallpaper yet, but we'll come with it in a couple of weeks and it's going to be really convenient!
Anyway, we're looking forward to creating a special noscript language for themes with a nice syntax and with all those type checkings we have to do manually now. It's going to be fast even on the web, as we're going to write it in Rust and compile it to WebAssembly for the editor. We'll also have a CLI for running noscripts that will let noscripts do even more.

For example, the noscript above would be similar to this in our themes noscript language:
for variable: color in allVariables:
let finalColor

if variable in theme:
finalColor = theme.|variable|
else:
finalColor = copy(color)
|variable| <- finalColor

finalColor.hue += 90

Stay tuned!
Have you ever wondered what does the button noscriptd ”Download the workspace” do? This button is very useful if you make use of custom palettes! Let's see how.

Let's define a color in the theme's custom palette, one of the ways you can do it is ”Edit the theme's custom palette” at the top → ”Add a new color” (define as much as you want and choose colors you like). If you download your theme using the button in the bottom right corner or ”Download .attheme directly” and open this file in the editor again, you won't see the palette you defined. What a pity!

If you use the ”Download the workplace" button, you'll get an .attheme-editor file. And this is not a theme you can apply in Telegram. The editor saved its internal representation of the theme. If you open the file in the editor, you'll see the palette in its original state. The editor saves everything in this file, including the theme's name and the custom palette. You may rename the file, but the editor will show the name saved in the file contents and not from its name.

This button will become even more useful with updates. We're planning on making linkage of variable, just like .tdesktop-theme does. When downloading an .attheme, all the linkage will have to be resolved and you won't be able to restore it back from .attheme. But with .attheme-editor, you'll always have a version of your theme with all linkage saved.
The editor now has support for wallpapers and strange behavior of variables in previews, so now we can cover more variables! 💪

Thanks to @danicotra for the first preview with chat_wallpaper!
Wow, there are 37 (thirty seven!) new variables in the latest update of Telegram. I haven't checked it out myself yet, but as far as I can see they are the variables for things we couldn't change for a long time. Recently the developer @DrKLO saw my article on bugs and replied that he'd fix them. I'm really happy now; thank you, @DrKLO!

So, we're going to update the editor with new variables as soon as possible, but before this I'll make two update statements for developers who use attheme-js and attheme-default-values. I'll do it here: although it's not the place for them, but the topic is pretty similar (and yeah, the editor uses them too), and the updates are important.
So, let me begin.

Yesterday I found a bug in attheme-js that led to wrong parsing of themes from @themesporterbot. attheme-js assumed that the file ends with \nWPE\n when it has a wallpaper, bu themes generated by the porter bot ended with \nWPE. I've updated the package so it always finds where WPE is.

If you have anything working on attheme-js, please update it, especially if you work with wallpapers. The new version is 1.1.2.
And on attheme-default-values. Recently I updated it to 5.0.0 because it has one breaking change. Using CommonJS, you should require it this way:
const defaultValues = require(`attheme-default-values`).default;

Note that .default at the end — the package has moved to ES Modules, so the way you required it before won't work anymore. If you used ES Modules before, it shouldn't harm you.

Also I follow SemVer starting with 5.0.0. Previously I tried to match Telegram's version, but now I'm going to publish 5.1.0 with those 37 new variables, and new variables will always be published as a patch change.

(Also if you use TypeScript, I provide declarations files since 5.0.0! The package was rewritten in it, and so will other my packages in a while.)
A brief update for developers of .attheme tools:

First of all, we've written a Rust crate for working with .attheme files. Check it out!

Second, we've rewritten attheme-js from scratch: now it has a better API and provides you with many tools you'll need when working with .attheme. It's been rewritten in TypeScript, and we now provide you typings so you can develop tools in TypeScript easier.

Third, attheme-default-values is deprecated in favor of attheme-js. You can find the default theme under attheme-js/lib/defaultThemes/default.
Telegram v5.0 has come out, and .attheme editor is already up to date with new variables!

But v5.0 not also brought new variables, but also deleted a bunch of old ones regarding colored headers. .attheme editor will show those as Removed since v5.0 so you can upgrade your themes more smoothly.

attheme-js and attheme-rs are also updated to v2.1.4 and v0.2.0 respectively with support of the new variables. Note that attheme-rs is now only compileable with Rust 2018, so be sure to install Rust 1.31 before updating the crate.
We've released a new version of .attheme editor to fix one bug. The bug is that opening themes with @atthemeeditorbot failed with an error. Now it works as good as always 😉

Just a reminder: whenever you face a red dialog saying ”Whops, an error happened”, you should report it to @snejugal or on our GitHub repository. That error always indicates a bug in the editor that must be fixed or properly handled by the editor. With your bug report, the editor will get a little better :)
FInally, .attheme editor is now available in Spanish! Thanks to @DiegoCanevaro for translation 👍
Finally, .attheme editor is released with new variables! Great thanks to @twitface for doing most of my work
Hi, devs! I've just released attheme-js@3.0.0. It now has support for the new default themes, including the ability to choose the accent color for the Mono, Dark and Arctic themes. Also, you can now use Attheme#fallbackToOther to fallback a theme to another one, and Attheme#fallbackToSelf that allows you to map new variables to already existing ones. Oh, and you can pass any iterable over [string, Color] to the Attheme constructor.

_But_ the constructor no longer has the second parameter, and instead you should use Attheme#fallbackToOther; all the default themes are now functions that generate Attheme instances; and lib/defaultThemes/default no longer provides all variables — instead, use the variable list at lib/variables.

And yeah, I have also updated attheme-rs to v0.3, which also now comes with updated themes. It no longer overloads + and | operators — use Attheme::fallback_to_other instead. Another noticable change is that the crate moved to using palette::Srgba<u8> instead of [u8; 4],

Hopefully you devs will like these updates! The edtor will also be updated with new variables this weekend, and I hope to make several improvements to the editor later on.