how to get color scheme in Liferay - liferay

is it possible in Liferay to get programmatically color scheme of theme?
I have to include different icons depending of current color scheme. I know that it is possible to do it by using css but in my issue it is better to get color scheme in java code

If you want to get the color scheme of the current page that you are in try the following code
ColorScheme colorScheme = (ColorScheme )request.getAttribute(WebKeys.WebKeys.COLOR_SCHEME);

Related

Display Grid background pattern in sublimetext

I'm looking for a way to set a grid background style in sublime editor similar as gedit provides in preferences panel. The image below illustrates when the Display grid pattern is toggled on in gedit. It's possible to set this same feature in sublime?
This is not currently possible in Sublime, no.
The background of files is always a solid color, whose color is controlled by the color scheme set in the color_scheme setting. That gives you the power to set a global color scheme background color, one that's specific to projects, and even ones that are specific to certain files or types of files, but it's always a solid color.

Sublime 3: can I change the font/size of comments?

Is there a way to make the comments a different (smaller) font from the rest of my code?
Although Sublime supports the idea that each view (editing pane) can have a unique list of settings, which includes font_face and font_size, it doesn't support multiple font faces or sizes from within a single view.
As such, it's not possible to have some elements use a different font face or size, although it's possible to change the font style to bold or italic, which is controlled by your color scheme.

TextInputLayout hint color for various states

I have been trying to customize the Hint color in TextInputLayout and it works fine. But the problem is that I have to define color when there is an error, normal/Activated which is working and disabled state of the field.
So I tried creating three different styles with color normal, color activated and so on. But this doesn't seem to change the colour. I have indicated the Appcombat theme as the parent theme as well in my custom styles. I have tried applying these styles through java file as well.
Also let me know on how to define the size of the Hint text through style.
A bit late to the party, but here goes my solution to this:
Set the same style in errorTextAppearance and hintTextAppearance, both with the same color for the item android:textColor. When showing an error, set the error using a spannable with a ForegroundColorSpan with the color you wish to display in the error field, while the hint will remain in the color defined by the style set in errorTextAppearance.

How to change color of indent guide option in sublime text3?

How to change indent guide color.
You need to edit the color scheme file for the color scheme you are using, and find <key>activeGuide</key> and/or <key>guide</key> and change the hex color value in the <string> node below it to the value of the color you desire. See How do I edit the Solarized (Light) theme in Sublime Text 3 for details on how to make custom changes to color schemes.

Why do all my MacVim color schemes look wrong?

I am having a problem with my MacVim color schemes. I have 'syntax on' in my .vimrc and I work mostly with Python.
As an example, I have attached a screenshot of what the "default" color scheme looks like in MacVim to me. I am having this problem with varying degrees of color differences for all the different schemes. Whenever I find a scheme I like online, it never looks like it does in the screenshot.
Any ideas on what the problem is?
Many themes provide modes for both dark background colors and light background colors. If you'd like to keep using this theme, try running:
:set background=light
Most of the themes I've seen were designed with a dark background and lighter text in mind -- I personally find a mostly-black screen easier on my eyes than a mostly-white screen -- so perhaps you just need to change the background color to something dark. In which case, you'd then want to run:
:set background=dark
The problem seems to be in ~/.gvimrc, look at what it does with the highlights (such as highlight NonText guibg=grey80). I've just placed them in an if !exists("stupid_colors").

Resources