Sublime to change COLOR of highlight_modified_tabs? - colors

In Sublime Text 2 editor, we can change the "Text Color" of "Modified/Edited Tabs" by using "highlight_modified_tabs": true like that. It works.
But it is bright red, how can i change the text color of it?

The correct location for these settings is in the packages folder for your installation (which can be opened using Preferences -> Browse Packages) inside the Theme - Default directory, in a file named Default.sublime-theme
Somewhere around line 570, the tab labels are configured.
They look a bit like this:
{
"class": "tab_label",
"parents": [{"class": "tab_control", "attributes": ["file_light"]}],
"attributes": ["dirty"],
"settings": ["highlight_modified_tabs"],
"fg": [125, 00, 125]
},
You want to configure the ones whose settings attribute is set to ["highlight_modified_tabs"]. Change the fg property to the desired RGB value.
There are four different sections to change, and they seem to correspond to the shade of the tab background.
Note that it's not necessary to modify the default theme where it is. You can create a new file named Default.sublime-theme in the User packages directory, and store only your changes which will be applied after the main theme file.
I copy and pasted the four highlight_modified-tabs sections and modified the two that I wanted.
[packages]/User/Default.sublime-theme:
[
{
"class": "tab_label",
"parents": [{"class": "tab_control", "attributes": ["file_light"]}],
"attributes": ["dirty"],
"settings": ["highlight_modified_tabs"],
"fg": [125, 00, 125]
},
{
"class": "tab_label",
"parents": [{"class": "tab_control", "attributes": ["file_medium"]}],
"attributes": ["dirty"],
"settings": ["highlight_modified_tabs"],
"fg": [125, 00, 125]
},
{
"class": "tab_label",
"parents": [{"class": "tab_control", "attributes": ["file_medium_dark"]}],
"attributes": ["dirty"],
"settings": ["highlight_modified_tabs"],
"fg": [255, 161, 52]
},
{
"class": "tab_label",
"parents": [{"class": "tab_control", "attributes": ["file_dark"]}],
"attributes": ["dirty"],
"settings": ["highlight_modified_tabs"],
"fg": [255, 161, 52]
}
]

Got the answer from Trevor Senior
The color schemes in sublime text are located in your sublime packages. In the menu navigate to Preferences -> Browse Packages... and they will all be listed in the Color Scheme - Default

Related

Microsoft Teams Adaptive Card - Dark Mode Color Issue

I am trying to develope a simple messagaging extension app for Microsoft Teams. With the use of Task Modules I can load a simple Adative Card. Works as designed. The only problem I have with it, is that my Adaptive Card has a color issue withing Microsoft Teams in Dark Mode.
Take a look at the image below. 1 shows a very simple Adaptive Card designed via https://adaptivecards.io/designer/ (preview mode). 2 the very same Adaptive Card but now an actual snippet from Microsoft Teams. As you can see the card below has some color issues which makes the input hard to see.
Here is the code I've used:
public async handleTeamsMessagingExtensionFetchTask(
context: TurnContext,
action: any
): Promise<any> {
const adaptiveCard = CardFactory.adaptiveCard({
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "${title}"
},
{
"type": "Input.Text",
"placeholder": "Placeholder text"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
});
return {
task: {
type: 'continue',
value: {
card: adaptiveCard,
height: 535,
title: '${title}',
url: null,
width: 500
}
}
};
}
There's not much that can be done about the input box itself in this case, but maybe try changing the colour of the label above it, something like this (I've changed some of your property names as well, as they were invalid case - things like "medium" instead of "Medium":
"size": "medium",
"weight": "bolder",
"text": "${title}",
"color": "good"
Color allows the following values:
"default"
"dark"
"light"
"accent"
"good"
"warning"
"attention"
If you nest your Text input into a Container, you are able change the Container's style to provide a coloured background upon which the Text input sits.
It's not necessarily right for your use case, but it could be a workaround of interest
Container Style colour options
{
"type": "Container",
"style": "emphasis",
"bleed": true,
"items": [
{
"type": "TextBlock",
"text": "Request New Ticket",
"wrap": true,
"fontType": "Default",
"style": "heading",
"size": "Large",
"color": "Good",
"weight": "Bolder",
"horizontalAlignment": "Center"
}
]
}

Using user-defined color in VS Code own Color Theme

In documentation of VS Code Extensions, it is mentioned that you can define your own color: https://code.visualstudio.com/api/references/contribution-points#contributes.colors
How can I use this color in the Color Theme I create?
For example, I have the following in package.json
"contributes": {
"themes": [
{
"label": "My Color Theme",
"uiTheme": "vs-dark",
"path": "./themes/my-color-theme.json"
}
],
"colors": [
{
"id": "color.gold",
"description": "Gold",
"defaults": {
"dark": "#FFB71B",
"light": "#FFB71B",
"highContrast": "#FFB71B"
}
}
]
}
And the following in my-color-theme.json (I would like to use "gold" for one of the item but it does not work):
{
"name": "My Color Theme",
"type": "dark",
"colors": {
"editor.background": "#000000",
"editor.foreground": "#FFFFFF",
"sideBarTitle.foreground": "color.gold",
},
...
}
Thanks
Color entries can only contain color values of the form #RGB, #RGBA, #RRGGBB or #RRGGBBAA, nothing else. No other color format (hsl etc.) or named color is supported. Hence "sideBarTitle.foreground": "color.gold" is an invalid entry.

How to set colors for buttons on slack using slack API

I'm trying to set other styles for slack buttons besides the default 3:
- primary (green)
- danger (red)
- default (grey)
I would like to set other colors for the buttons for example orange.
I'm aware that it's possible to set custom colors for attachments by specifying hexcodes.
Is there a way to specify custom colors for slack buttons?
Here's what I tried:
{
"text": "Please rate this trip.",
"attachments": [
{
"callback_id": "rate_trip",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "yes",
"text": "yes :thumbsup:",
"type": "button",
"value": "yes",
"style": "primary"
},
{
"name": "no",
"text": "no :thumbsdown:",
"type": "button",
"value": "no",
"style": "danger"
},
// I'd like to make the style for this to be orange but it defaults to grey.
{
"name": "maybe",
"text": "maybe :neutral_face:",
"type": "button",
"value": "maybe",
"style": "#FFA500",
}
}
]
}
]
}
Here's a screenshot of the outcome of this code.
No. Slack does not allow you do use custom colors for buttons. As you mentioned you can only use "styles" (in the style field) to color a button and are limited to default, primary and danger.
See here for the official documentation on this very topic.

Is it possible to change background color of some code in Sublime Text 3?

I want change background color of calls __$sa__login and gtag, so I can quickly find all the 'analytic' code in a .js file.
this.__$sa__login(user.id)._____
....
gtag( { 'Country': user.zoneId } )
Something like this:
I found a solution with this great Sublime Text plugin HighlightWords
Here is my config:
{
// The colors to highlight texts are specified by a list of theme scope names,
// and HighlightWords uses this list in circular order.
"colors_by_scope": [
"string",
"entity.name.class",
"variable.parameter",
"invalid.deprecated",
"invalid",
"support.function"
],
"whole_word": false,
"use_regex": true,
"ignore_case": false,
// Keywords to be always highlighted, clear the list to disable it.
// "keyword" are literally matched, and "color" refers to theme scope names.
// "flag": 0 - regex, 1 - literal (default), 2 - regex and ignore case, 3 - literal and ignore case
// Note that json has some special characters like '\' should be escaped.
"permanent_highlight_keyword_color_mappings": [
{"keyword": "TODO", "color": "support.function"},
{"keyword": "FIXIT .*", "color": "support.function", "flag": 2},
{
"flag": 0,
"keyword": "this\\.__\\$sa__\\w+\\(.*?\\)\\._+",
"color": "text.html.vue source.js.embedded.html meta.export.js meta.object-literal.js meta.object-literal.js meta.block.js meta.function-call.method.js meta.group.js string.quoted.single.js"
},
{
"flag": 0,
"keyword": "gtag\\(.*?\\)",
"color": "text.html.vue source.js.embedded.html meta.export.js meta.object-literal.js meta.object-literal.js meta.block.js meta.function-call.method.js meta.group.js string.quoted.single.js"
}
]
}

How change color text in tabs in Sublime Text 3?

(English is not my native language)
Hello. Text in tabs is badly visible in my color scheme. How I can change its color? I want that color of the text both in active, and in inactive tabs exchanged. Thanks.
Add to your Default.sublime-theme, where tab_label sets the color of the text and tab_control the color of the tab itself:
[
{
"class": "tab_label",
"fg": [127, 255, 212]
},
{
"class": "tab_control",
"attributes": ["selected"],
"tint_modifier": [255, 215, 0, 225]
}
]
in the attribute fg you define a rgb based color. If you want it only for the selected tab you can add "parents": [{"class": "tab_control", "attributes": ["selected"]}], to limit its scope.
If Material Theme Package installed, add following settings at "Preferences" >> "Customize Theme"
In "rules" lable add following settings.
"rules":
[
{
"class": "tab_label",
"fg": [255, 255, 255]
}
]

Resources