mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
[themes] add seti theme
This commit is contained in:
parent
ce1f925f16
commit
fe22ac384b
8
extensions/theme-seti/OSSREADME.json
Normal file
8
extensions/theme-seti/OSSREADME.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
|
||||
|
||||
[{
|
||||
"name": "seti-ui",
|
||||
"version": "0.1.0",
|
||||
"repositoryURL": "https://github.com/jesseweed/seti-ui",
|
||||
"description": "The file ./icons/seti.woff has been copied from https://github.com/jesseweed/seti-ui/blob/master/styles/_fonts/seti/seti.woff"
|
||||
}]
|
169
extensions/theme-seti/build/update-icon-theme.js
Normal file
169
extensions/theme-seti/build/update-icon-theme.js
Normal file
|
@ -0,0 +1,169 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var https = require('https');
|
||||
var url = require('url');
|
||||
|
||||
function getCommitSha(repoId, repoPath) {
|
||||
var commitInfo = 'https://api.github.com/repos/' + repoId + '/commits?path=' + repoPath;
|
||||
return download(commitInfo).then(function (content) {
|
||||
try {
|
||||
let lastCommit = JSON.parse(content)[0];
|
||||
return Promise.resolve({
|
||||
commitSha: lastCommit.sha,
|
||||
commitDate: lastCommit.commit.author.date
|
||||
});
|
||||
} catch (e) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}, function () {
|
||||
console.err('Failed loading ' + commitInfo);
|
||||
return Promise.resolve(null);
|
||||
});
|
||||
}
|
||||
|
||||
function download(urlString) {
|
||||
return new Promise((c, e) => {
|
||||
var _url = url.parse(urlString);
|
||||
var options = { host: _url.host, port: _url.port, path: _url.path, headers: { 'User-Agent': 'NodeJS' }};
|
||||
var content = '';
|
||||
var request = https.get(options, function (response) {
|
||||
response.on('data', function (data) {
|
||||
content += data.toString();
|
||||
}).on('end', function () {
|
||||
c(content);
|
||||
});
|
||||
}).on('error', function (err) {
|
||||
e(err.message);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function invertColor(color) {
|
||||
var res = '#'
|
||||
for (var i = 1; i < 7; i+=2) {
|
||||
var newVal = 255 - parseInt('0x' + color.substr(i, 2), 16);
|
||||
res += newVal.toString(16);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
exports.update = function () {
|
||||
var fontMappings = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/_fonts/seti.less';
|
||||
console.log('Reading from ' + fontMappings);
|
||||
var def2Content = {};
|
||||
var ext2Def = {};
|
||||
var fileName2Def = {};
|
||||
var def2ColorId = {};
|
||||
var colorId2Value = {};
|
||||
|
||||
function writeFileIconContent(info) {
|
||||
var iconDefinitions = {};
|
||||
|
||||
for (var def in def2Content) {
|
||||
var entry = { fontCharacter: def2Content[def] };
|
||||
var colorId = def2ColorId[def];
|
||||
if (colorId) {
|
||||
var colorValue = colorId2Value[colorId];
|
||||
if (colorValue) {
|
||||
entry.fontColor = colorValue;
|
||||
|
||||
var entryInverse = { fontCharacter: entry.fontCharacter, fontColor: invertColor(colorValue) };
|
||||
iconDefinitions[def + '_light'] = entryInverse;
|
||||
}
|
||||
}
|
||||
iconDefinitions[def] = entry;
|
||||
}
|
||||
|
||||
function getInvertSet(input) {
|
||||
var result = {};
|
||||
for (var assoc in input) {
|
||||
let invertDef = input[assoc] + '_light';;
|
||||
if (iconDefinitions[invertDef]) {
|
||||
result[assoc] = invertDef;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
var res = {
|
||||
fonts: [{
|
||||
id: "seti",
|
||||
src: [{ "path": "./seti.woff", "format": "woff" }],
|
||||
weight: "normal",
|
||||
style: "normal",
|
||||
size: "150%"
|
||||
}],
|
||||
iconDefinitions: iconDefinitions,
|
||||
// folder: "_folder",
|
||||
file: "_default",
|
||||
fileExtensions: ext2Def,
|
||||
fileNames: fileName2Def,
|
||||
light: {
|
||||
file: "_default_light",
|
||||
fileExtensions: getInvertSet(ext2Def),
|
||||
fileNames: getInvertSet(fileName2Def)
|
||||
},
|
||||
version: 'https://github.com/jesseweed/seti-ui/commit/' + info.commitSha,
|
||||
};
|
||||
fs.writeFileSync('./icons/seti-icon-theme.json', JSON.stringify(res, null, '\t'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
var match;
|
||||
|
||||
return download(fontMappings).then(function (content) {
|
||||
var regex = /@([\w-]+):\s*'(\\E[0-9A-F]+)';/g;
|
||||
while ((match = regex.exec(content)) !== null) {
|
||||
def2Content['_' + match[1]] = match[2];
|
||||
}
|
||||
|
||||
var mappings = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/icons/mapping.less';
|
||||
return download(mappings).then(function (content) {
|
||||
var regex2 = /\.icon-(?:set|partial)\('([\w-\.]+)',\s*'([\w-]+)',\s*(@[\w-]+)\)/g;
|
||||
while ((match = regex2.exec(content)) !== null) {
|
||||
let pattern = match[1];
|
||||
let def = '_' + match[2];
|
||||
let colorId = match[3];
|
||||
if (pattern[0] === '.') {
|
||||
ext2Def[pattern.substr(1)] = def;
|
||||
} else {
|
||||
fileName2Def[pattern] = def;
|
||||
}
|
||||
def2ColorId[def] = colorId;
|
||||
}
|
||||
var colors = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/ui-variables.less';
|
||||
return download(colors).then(function (content) {
|
||||
var regex3 = /(@[\w-]+):\s*(#[0-9a-z]+)/g;
|
||||
while ((match = regex3.exec(content)) !== null) {
|
||||
colorId2Value[match[1]] = match[2];
|
||||
}
|
||||
return getCommitSha('jesseweed/seti-ui', 'styles/_fonts/seti.less').then(function (info) {
|
||||
try {
|
||||
writeFileIconContent(info);
|
||||
if (info) {
|
||||
console.log('Updated to jesseweed/seti-ui@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}, console.error);
|
||||
}
|
||||
|
||||
if (path.basename(process.argv[1]) === 'update-icon-theme.js') {
|
||||
exports.update();
|
||||
}
|
||||
|
||||
|
||||
|
BIN
extensions/theme-seti/icons/seti.woff
Normal file
BIN
extensions/theme-seti/icons/seti.woff
Normal file
Binary file not shown.
1036
extensions/theme-seti/icons/vs-seti-icon-theme.json
Normal file
1036
extensions/theme-seti/icons/vs-seti-icon-theme.json
Normal file
File diff suppressed because it is too large
Load diff
20
extensions/theme-seti/package.json
Normal file
20
extensions/theme-seti/package.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "vscode-theme-seti",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "A file icon theme made out of the Seti UI file idons",
|
||||
"publisher": "vscode",
|
||||
"scripts": {
|
||||
"update": "node ./build/update-icon-theme.js"
|
||||
},
|
||||
"engines": { "vscode": "*" },
|
||||
"contributes": {
|
||||
"iconThemes": [
|
||||
{
|
||||
"id": "vs-seti",
|
||||
"label": "Seti (Visual Studio Code)",
|
||||
"path": "./icons/vs-seti-icon-theme.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
32
extensions/theme-seti/thirdpartynotices.txt
Normal file
32
extensions/theme-seti/thirdpartynotices.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
|
||||
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
||||
For Microsoft vscode-theme-seti
|
||||
|
||||
This file is based on or incorporates material from the projects listed below ("Third Party OSS"). The original copyright
|
||||
notice and the license under which Microsoft received such Third Party OSS, are set forth below. Such licenses and notice
|
||||
are provided for informational purposes only. Microsoft licenses the Third Party OSS to you under the licensing terms for
|
||||
the Microsoft product or service. Microsoft reserves all other rights not expressly granted under this agreement, whether
|
||||
by implication, estoppel or otherwise.†
|
||||
|
||||
1. Seti UI - A subtle dark colored UI theme for Atom. (https://github.com/jesseweed/seti-ui)
|
||||
|
||||
Copyright (c) 2014 Jesse Weed
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Loading…
Reference in a new issue