ryanraposo / codeui Goto Github PK
View Code? Open in Web Editor NEWCustomize your color theme for VS Code.
Home Page: https://marketplace.visualstudio.com/items?itemName=ryanraposo.codeui
License: MIT License
Customize your color theme for VS Code.
Home Page: https://marketplace.visualstudio.com/items?itemName=ryanraposo.codeui
License: MIT License
(3/3)
On the color-picker
branch (see #24), a new view called Colors was added. Right now, there is no way to access or apply the selection.
To make it useful, step three is to...
(package.json) Add a new "command" copySelectedColor with fitting icon
(package.json) Add a new "view/title" copySelectedColor, when view == codeui.views.color
(src/extension.ts) Register command copySelectedColor --> colorProvider.copySelectedColor()
Probably could be improved by deleting more from the start:
Expected | Actual |
---|---|
Activity Bar => Badge Background |
Activity Bar => Barbadge Background |
Peek View => Border |
Peek View => View Border |
Welcome Page => Button Background |
Welcome Page => Page Button Background |
... | ... |
1-word titles are all looking great though.
(1/3)
On the color-picker
branch (see #24), a new view called Colors was added. Right now, there is no way to access or apply the selection.
To make it useful, step one is to...
(media/main.js) Add a new constant vscode
, set to acquireVscodeApi()
.
(media/main.js) Add a new constant initialColor
. Set it to any hex color string.
(media/main.js) Add a new variable currentState
. It should equal vscode.getState()
if it exists, {color : initialColor }
if not.
(media/main.js) Add a new function updateSelectedColor
. It should:
Accept a message to send. (Will be a dict with format: {type:'updateSelectedColor', value:'#000000'}
)
Use vscode.postMessage()
to report the new selection to the extension.
(media/main.js) Add a new function saveState
. It should:
Accept a state,
Save it with vscode.setState()
. This is for persistence across sessions.
Update the currentState instance.
Report the new color to the extension using the new updateSelectedColor
function.
(media/main.js) Change colorWheel so that it initializes with currentState
's color.
(media/main.js) Add to colorWheel.onChange
: Use new saveState function to store and report the selection.
Thank you for being part of the Open VSX community by adding your extensions to the Open VSX Registry. Please note that the service was recently transferred to the Eclipse Foundation and urgent action on your part is needed so we can continue to list your extensions. To ensure uninterrupted service, please sign the Eclipse Publisher Agreement on or before January 8, 2021. If not signed by that date, your extensions will be delisted and will no longer appear on the site nor be available via the API. If you sign at a later date, your extensions will then be re-activated. The signing process is explained in the Wiki (steps 1 and 2).
Please also note that all extensions MUST have a license in order to be listed.
More details are in these recent blog posts:
https://blogs.eclipse.org/post/brian-king/open-vsx-registry-under-new-management
https://blogs.eclipse.org/post/brian-king/new-era-open-vsx-registry
Today, thereβs growing momentum around open source tools and technologies that support Visual Studio (VS) Code extensions. Leading global organizations are adopting these tools and technologies. This momentum has spurred demand for a marketplace without restrictions and limitations. Thanks for joining us on this journey as we continue to build the Open VSX community. We look forward to continued innovation from you in 2021!
(2/3)
On the color-picker
branch (see #24), a new view called Colors was added. Right now, there is no way to access or apply the selection.
To make it useful, step two is to...
(src/color.ts) Add private property ColorProvider.selectedColor
(src/color.ts) Add to colorProvider.onDidRecieveMessage: If message.type=="updateSelectedColor"
, set self.selectedColor
to message.value
.
(src/color.ts) Add public function ColorProvider.copySelectedColor(). It should:
Copy self.selectedColor to clipboard. See ElementProvider.copy()
in src/elements.ts for reference.
Use public function showNotification
from src/extension.ts to show a popup, notifying the user.
I'd really appreciate a fresh take on the README.
The format hasn't changed much since release, and I think I'm too 'involved' to do it justice. Its a pretty extension, and it could really shine here... but I don't think it is right now.
Help!
The latest changes can be found on the color-picker
branch. That incoming update is the main motivator for this. Thanks!
Using an external color picker is annoying and VS Code's built-in picker is restricted to text editing:
Use color-picker
branch for work on this feature.
(12/09/2020): Simple copy-to-clipboard functionality added. Not the minimum-viable-product we need, but a start. Very interested in help/feedback. Two rules, though! 1) no frumpy webview abuse and 2) keep it simple :)
(11/27/2020) : A new view 'Color' with a picker has been added. No way to access the selection yet.
So, to iterate, instead of:
"workbench.colorCustomizations": {
"activityBar.background": "#2f363c"
}
You do
"workbench.colorCustomizations": {
"[Github]": {
"activityBar.background": "#2f363c"
}
}
Where Github
is active theme that was modified by the extension.
In CodeUI, each element's info comes from from a data file: data/vscodeElementsArray.json.
Here is the data for "activityBar.foreground"
:
In Standard View, we use the groupedName
to avoid redundancy. In Palette View, there isn't much context, so elements need their full name, or titleName
.
As shown below, elements are currently showing their shorter, groupedName
in Palette View. This is π. Without hovering over them, it's hard to tell what they are:
#ccc
& #cccccc
is in 2 different groupsAll 4 colors are the same:
#fff
#ffff
#ffffff
#ffffffff
EDIT(@ryanraposo):
Hello
thank you very much for sharing your great work!
I am trying to start with CodeUI but stumble with three questions:
#1:
It is not clear what exactly CodeUI can doYou sum it up like this: "Customize your color theme for VS Code."
But: What does it mean?
README.md
It would be great if the README.md
: features chapter explains with one or two sentences what CodeUI does.
#2:
Can we adjust language syntax colors, too?If we change the theme, the color in the displayed source code is changed, too.
Is it possible to e.g. change the color of a variable, too:
I was not able to find a Syntax / Variable element in CodeUI.
Thanks a lot, kind regards,
Thomas
Probably > 95% of the time people will use the Global
settings file, so I would like a setting to skip the scope choosing Quick Pick. (An just write to the Global
).
Generally, a great 'What's New' page would:
Being early in development, and especially with the color picker update around the corner, priority is even higher!
We really want existing users who maybe haven't opened CodeUI in a while to notice :)
(Big thank you to @alefragnani! His beautiful 'What's New' page for the Bookmarks extension inspired the idea, and his extra work made this easy for all of us!)
Without a pre-existing entry for "workbench.colorCustomizations"
in the user's settings.json
file (VS Code settings), all customization functionality breaks:
This is a pretty serious bug, I'm not sure when it was introduced.
A temporary workaround is to add the empty entry ("workbench.colorCustomizations" : {}
) manually, as pictured above.
However, keep in mind the different versions of settings.json
. CodeUI has features for workspace-specific customization, and in that scenario you would have to add the entry to that particular settings.json file (.vscode/settings.json
).
The color picker in the Color view should automatically resize to fit the view.
The 'Color' view in CodeUI is a Webview, which is no different than an ordinary webpage.
The HTML comes from a template literal:
Lines 65 to 87 in fff58bb
This is the JavaScript behind the view:
Lines 5 to 49 in fff58bb
Currently, there is no CSS other than the stylesheet included with the color picker package:
codeui/media/lib/reinvented-color-wheel.css
Lines 1 to 42 in 2325927
Note: the package, reinvented-color-picker, is located in
codeui/media
alongsidemain.js
(above). It is stored locally (not via npm) in thelib
folder:media βmain.js ββββlib β reinvented-color-wheel.min.css β reinvented-color-wheel.min.js
The solve for this issue could involve:
./media/lib/reinvented-color-wheel.css
or a new file, ex: ./media/style.css
)./media/main.js
:Lines 36 to 47 in fff58bb
The VS Code Extension API. I can help with this side of things if you are only comfortable with the 'traditional web' stuff.
An example is the onDidChangeVisibility
event of the WebviewView. For the most part, we can work within the webview--but if we want to detect open/close/collapse events for the view container itself, we need to 'ask' VS Code.
Darken/Lighten with hard-coded 10%
is not going to be enough for everyone.
Ideally having an input that you can put any value: 0.333333
or 50
.
I mean, shortcuts are great and should stay:
Where picking custom value would bring another Quick Pick inviting to enter the number value.
It's usually a good idea to commit a lock file
https://stackoverflow.com/questions/44552348/should-i-commit-yarn-lock-and-package-lock-json-files
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.