GithubHelp home page GithubHelp logo

solutioncolors's Introduction

Solution Colors for Visual Studio

Allows you to associate a color with a solution or folder and display it in various locations within Visual Studio. Inspired by the Peacock extension for VS Code and this Visual Studio feature request.

Build

Download this extension from the Visual Studio Marketplace or get the CI build.


When you have multiple instances of Visual Studio open at the same time, it can be tricky to tell them apart. Especially if you’re working on different branches of the same solution, which makes them look almost identical. This extension solves this issue by colorizing each instance to make it easy to tell them apart.

Top of VS

The result is a subtle, yet very visible colorization that doesn’t feel noisy or distracting. It puts you in control with an array of customization options.

Getting Started

To enable colorization, open a solution or folder in Visual Studio.
In the Solution Explorer window > Right click the top level solution > Set Solution Color > (Select Color)
From here you can choose between a list of predefined colors matching the color palette used for colorizing document tabs.

Solution Context Menu

You are not limited to only choosing between the predefined colors. By selecting Custom... you can choose any custom color from the color dialog.

custom colors

Visual Studio stores the color in the .vs folder next to the solution file or in the root of the workspace folder. That ensures that the same solution will always receive the same color.

After selecting a color manually, the Automatic button changes to None. That allows you to remove the color if you no longer want it.

Context Menu None

Automatic

Instead of manually assigning a color to every solution, Visual Studio can do it automatically. With this option enabled, all solutions will be assigned a color when opened. The color is calculated based on the hash of the full path of the solution, so each solution will always be assigned the same color.

When Automatic colorization is enabled, the button in the submenu shows a checkmark.

Context Menu Disable

When automatic colorization is enabled, you can still choose your own custom color for your solution. A manually selected color always takes precedence over automatic.

Colorized elements

  • The solution name in the title bar is visible at all times and located at the top, which makes it a prime location for colorization.

    Solution Label

  • In addition, the 3 top-most pixels of Visual Studio span the full width of the window. This is especially visible when Visual Studio instances are floating or if you’ve chosen not to display the solution name label.

    Top

  • The Windows Taskbar shows the colors in the thumbnails as well.

    Taskbar

  • And if you don’t group the Taskbar items, each item will show the color as well.

    Taskbar Icons

This gives you 4 different locations to display the color and you can use all of them, or just the ones you find most helpful. You can control all that from the Tools -> Options page.

Options

To customize the colored borders, open the Border settings dialog and chose which borders and what thickness to display.

Border settings

How can I help?

If you enjoy using the extension, please give it a ★★★★★ rating on the Visual Studio Marketplace.

Should you encounter bugs or if you have feature requests, head on over to the GitHub repo to open an issue if one doesn't already exist.

Pull requests are also very welcome, since I can't always get around to fixing all bugs myself. This is a personal passion project, so my time is limited.

Another way to help out is to sponsor me on GitHub.

solutioncolors's People

Contributors

arkane5 avatar ascottvhz avatar ho-cooh avatar jaredburkeen avatar jp41011 avatar justdmitry avatar lsoft avatar madskristensen avatar mkornreder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

solutioncolors's Issues

Make it configurable on a per-user basis

Hello there, thanks for this simple but useful extension. :-)

My suggestion would be to make this configurable on a per user basis, instead of saving the color in the actual .sln file, which is shared across all team members, and some may not like others' chosen colors. ;-)

Thank you very much.
Kind regards.

Automatic mode is not working

Describe the bug
Seems like the latest release 1.1.56 breaks the Auto mode compared to 1.1.44. I looked through the commits, there are several changes made to them, but wasn't released for publish.

To Reproduce
Steps to reproduce the behavior:

  1. Turn off auto-mode in settings, and manually assign a color to a solution. This works as expected.
    image

  2. Turn on auto-mode in settings. Color disppeared. (And now manually assigning any color does not take effect)
    image

Expected behavior
Color should be assigned to an automatic color.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Implement also in floating Test Explorer windows

Thanks for this great extension :)

I always have the Text Explorer window pulled out onto separate monitors.
Can this colourisation also be implemented at the bottom of this window as well so it's easier to identify which solution the window applies to.

thanks

Same color in different repository of same project

Hi Mads,

great work, great extension, but there is one thing with it that puzzles me.

I have two clones of the same remote repository on my computer. One is for my current work, the other for peeking into other branches and/or fixing my PRs.

If I set a color for the solution in my main repo, I can see the color.txt file inside of the .vs folder in the repository. If I then open the second repository, it gets the same color and I can't see why. This repository has no color.txt file in it. Once I set another color in the second repository, They each have separate colors and all works as expected.

Steps to reproduce:

  1. Clone a repository
  2. Clone the same repository again to another folder
  3. Open the solution in repository 1 in VS
  4. Set the color for the solution to something
  5. Open the solution in repository 2 in VS
  6. See that it has the same color as set in repository 1 (This is the wrong situation I was mentioning)
  7. Set another color for slution in repository 2
  8. Close and repoen both solutions and check that each have the colors set to them

What I had expected is that in step 6, the solution in repository 2 has no color set.

Kind regards
Thomas

Place an overlay icon on the taskbar button

Is your feature request related to a problem? Please describe.

I use multiple Visual Studio instances regularly. I already have a tool that separates the Visual Studio buttons on the taskbar. Otherwise I'd go crazy with the slow procedures of the taskbar. So now I have two buttons but they look the same. Their ordering remains the same unless I close and reopen one of the windows. But they should be distinguishable to pick the right one when I'm working with the mouse.

Putting a colour bar inside the window doesn't help at all because you don't see it before you're there. The colour bar might only be a stronger indicator to know that you've landed in the wrong window again.

Describe the solution you'd like

There should be an overlay icon on the taskbar button to clearly identify each window. You can't go wrong when you click on the button that has the initial letters or even the icon of the project you want to work with.

There was an extension for Visual Studio that did this but the ever-changing extensibility APIs of Visual Studio regularly breaks such useful extensions. I could hack it into VS 2019 but failed with VS 2022.

Describe alternatives you've considered

There is currently a workaround on another level, outside of Visual Studio, using Windhawk. It doesn't support icons though.

Additional context

grafik

Inject custom text into taskbar pane based on solution path

Is your feature request related to a problem? Please describe.
I am still struggeling to distinct some solutions because the colors are too similar when using auto color

Describe the solution you'd like
it would be great if next to the taskbar icon there could be a custom pattern to extract text and display it next to the color. Effectively most of my projects are built like

  • TheProjectName/src/All.sln
  • TheProjectName/src/A/A.csproj
  • TheProjectName/src/B/B.csproj

If i could specify a pattern like
grafik
globally (while being able to override it per solution)

getting the right solution would be a nobrainer. Heck even manually setting the text instead of regex extracting it from the solution would make spotting the right solution a lot easier.

Describe alternatives you've considered
Quit naming my templated projects All.sln but TheProjectName.sln instead

No badge is shown on the non-compact Titlebar even though Option is set

Describe the bug
When not using compact menu and search bar option, the titlebar badge is not displayed.

To Reproduce

  1. Have installed: Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
    Version 17.7.0 Preview 2.0
  2. Install version 1.1.44 of Solution Colors by Mads Kristensen
  3. Open Tools...Options..Environment...General
  4. Ensure Use compact menu and search bar is unselected.
  5. Open Tools...Options...Environment...Fonts and Colors...Solution Colors
  6. See that Show title bar is defaulted to True.
  7. Press OK.
  8. Restart if necessary to apply compact menu change from step 4.

Expected behavior
I expect to see the solution name as a badge on the titlebar, just as I do for [PREVIEW | ADMIN]

Screenshots
image
image
image

Additional context
Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
Version 17.7.0 Preview 2.0

Error loading package

I get the following error when loading the package:

The 'SolutionColorsPackage' package did not load correctly, The problem may have been caused by à configuration change or by the installation of another extension. You can get more information by examining the file [...]Activit Log.xml'.
Restarting Visual Studio could help resolve this issue.
Continue to show this error message?

Color or highlight file types within solution explorer

I don't know if it would make sense within this extension, but I would love to have the ability to highlight or color certain file types within solution explorer. When solution explorer has many projects, it can be difficult to navigate and find what I need - highlighting certain file types would increase productivity within VS. I've tried looking at the code for the FileIcons to make sense of interacting with solution explorer but was unable to get it to work.

Feature request: Custom color picking by entering hex code or RGB values

As title, the "Peacock" extension of VS Code has this feature but "Solution Colors" does not. Maybe you can refer to the source code of a similar extension (this is what I used before but unfortunately, the author of the extension does not have any plan to update it to support VS 2022, it seems to be abandoned) - https://marketplace.visualstudio.com/items?itemName=Wumpf.SolutionColor - for implementing this. Thank you very much for your time and effort!

Allow installation in VS2019

Thanks for the extension. I'd like to use it in my work machine, where we use VS2019.

I changed the .vsixmanifest and other files from 17.0 to 16.0 and I've been able to install it, but when opening VS, the extension crashes.

Can it be ported to VS2019 or it's dependant on VS2022?

Branch Based Coloring

I would like to be able to apply color based on the branch name. E.g., "master" is red; "develop" is yellow; a branch named "US*" is green; etc.

Show the Border in the 4 locations at the same time

As titled, I wish it is possible to have an option (Border > Location) called (ALL) to display the Border in the four locations simultaneously (Top+Left+Bottom+Right), rather than just selecting one as it is now.
I believe distinguishing between the IDE instances will be easier and faster.
Thank you very much for your time and effort!

Clarify Getting Started section instructions of the README

The instructions on how to enable SolutionColors are not clear for a new first-time user.
It was confusing for me, and it seems to have also confused several other users in the Q&A section for this extension in the Visual Studio Marketplace.
Reference: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.SolutionColors&ssr=false#qna

From the instructions it was not very clear What or Where I had to right click to get the context menu shown in the screenshot.

I think it might be helpful to clarify the instructions and to maybe provide a screenshot that provides more context.
Personally, it wasn't clear what the "it" in "... right-click it to select the Set Solution Color submenu..." was referring to exactly so I wasn't sure what I should be right clicking on.

I was trying to right click the Solution name that is in the middle and at the top of the Visual Studio window since that is one of the main things that stands out in all the other screenshots. It's the solution name and it colorized so I thought that was what I should to be right clicking on.

I'll submit a pull request with a suggestion, but any clarification here would be helpful.

Top border steals clicks

It would be nice if top border wouldn't steal clicks. When I want to close VS I instinctively move mouse to the most top-right corner and click to close it. When there is a top border it doesn't work :)

"Show on taskbar icons" doesn't work

Don't see any difference in taskbar with "Show on taskbar icons" turned on.

devenv_2022-08-11_10-03-39

Tried with "Show on taskbar thumbnails" both on and off, restarted both VS after every change.

Grouping disabled in taskbar settings.

What I miss?

Windows 10, VS 17.3.0.

Active solution color is not set on title bar with activated experimental control styles although the option is set to true

The solution color is not displayed on the title bar although the option is set to true.
This occurs only when the preview option "experimental control styles" is also set to true.

To Reproduce

  1. Activate "experimental control styles" in preview features and restart.
  2. Set a solution color (or enable auto-mode)
  3. Acivate "Show on title par" in the "Solution Colors" options.

Expected behavior
The solution name in the title bar should have the selected solution color as background color

Additional context
Visual Studio 2022 Preview version 17.9.0 Preview 1.0

Color is not restored on reopen

Apparently the solution color is not being restored when I close and reopen the solution.

Tested with four different solutions and on two different machines, both running Visual Studio Community 17.2.6.

Border Settings window size is incorrect on Surface Pro 7

The Border Settings window size is incorrect on Surface Pro 7. The Surface Pro 7 has a screen size of 12.3 inches, resolution 2736x1824 and 267 PPI.

To Reproduce
Steps to reproduce the behavior:

  1. Right click on Solution name
  2. Select Set Solution Color > Options
  3. Select Border settings and click the ... button
  4. The Border settings window is displayed but the window size is not large enough to completely show the Cancel and OK buttons. See the screenshot of the Border settings window attached.

Expected behavior
The Cancel and OK buttons should be completely visible.

Screenshot 2023-02-22 182638-1

Consider adding color thumbnail to standalone editor windows

Is your feature request related to a problem? Please describe.
image

Quite a lot of the time, I need to jump between dragged-out standalone editor windows between two solutions, like the above. I want the solution color thumbnail to also show on those window as well.

Describe the solution you'd like
Show color thumbnail on all the windows created under the same solution.

Describe alternatives you've considered
Nope, having this extension is already boosting my productivity a lot.

Additional context
Add any other context or screenshots about the feature request here.

Colors on taskbar icons are getting mixed up

I have two instances of Visual Studio with each a distinct solution color. I have set the option to show the color in the taskbar icon. I use Windows 11 version 23H2 (22631.3007)
The pink solution was on my right screen, the blue on my left. Suddenly, the icon on my right, that should have been pink was blue also. The solution coloring itself was still ok. Even stranger, when I closed the pink instance on the right, the taskbar icon on the left went pink!

Steps to reproduce the behavior:

  1. Open two instances of Visual Studio
  2. Open two solutions
  3. Set a color for each solution
  4. Move each Visual Studio instance to its own monitor
  5. Clicking in one solution's projects effects the taskbar icon color in the other Visual Studio instance.

I have not been able to exactly reproduce the error, but it fails always. It should not be difficult to reproduce.

Custom Visual Studio icon per Solution

Is your feature request related to a problem? Please describe.
Not a problem but rather an enhancement: More often than not I work with a bunch of ungrouped solutions. Being able to distinguish them by color is fine but "not enough" 😄

image

They all share the same company prefix, so I can't distinguish them by the first letters of the name. They all start with Man... as you can see... 🙄

Describe the solution you'd like
It would be even better if I was able to define a custom icon for each Visual Studio instance.
This screenshot doesn't look very nice, but I think you'll get the point 😉

image

Describe alternatives you've considered
./.

Additional context
./.

Colorize the borders of the filetabs in the same color as the solution

Hi,

thx for your great extension

Is it possible to Colorize the borders of the filetabs in the same color as the solution?

In VS 2022 (perhaps also in earlier Version) there is an option to "Color the document tabs". But this uses an other color (i.e. brown) as your extensiong (blue on the top of the screenshot). It would be great if the colors were the same

image

In the following screenshot the point (for coloring) in the VS options dialog ist shown.

image

Im looking forward to hearing from you

best regards

Add ARM support

I'm using Visual Studio 2022 ARM on Windows 11 in Parallels virtual machine on an M1 MacBook Pro. I would love to use this extension but the only supported architecture is amd64. Please consider adding ARM support. Thank you!

VSIX does not support solution filters (slnf).

Describe the bug
I have a big sln, and a few slnf (with different subset of projects) on this sln. If I choose color for one slnf, I see the same color for all slnf based on this sln. I would prefer to see different colors in different slnfs.

To Reproduce
Steps to reproduce the behavior:

  1. Create sln, and 2 slnf.
  2. Open 1st slnf and choose color.
  3. Close solution, open 2nd slnf.
  4. You will see the same color.

Additional context
There are difficulties to get full path to slnf file from VSIX, described here with no feedback.

Automatic coloring does not work in some cases

For one of my solutions, automatic color does not work (no color is displayed). Manually choosing a color works.

Affected version
1.1.65

To Reproduce
Steps to reproduce the behavior:

  1. Open a specific solution (see end of additional context, below)
  2. See error (no color, and exception in output window)

Expected behavior
The solution has a color.

Additional context
The following exception stack trace is displayed in output/Extensions:

System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
at SolutionColors.ColorCache.GetColor(String filePath) in D:\a\SolutionColors\SolutionColors\src\ColorCache.cs:line 57
at SolutionColors.ColorHelper.d__16.MoveNext() in D:\a\SolutionColors\SolutionColors\src\ColorHelper.cs:line 273
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SolutionColors.ColorHelper.d__9.MoveNext() in D:\a\SolutionColors\SolutionColors\src\ColorHelper.cs:line 109
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SolutionColors.SolutionColorsPackage.<b__6_0>d.MoveNext() in D:\a\SolutionColors\SolutionColors\src\SolutionColorsPackage.cs:line 77
--- End of inner exception stack trace ---
---> (Inner Exception #0) [eluded, repeat of the above]

After reading the source code of the extension, I noticed that the problem went away if I renamed the solution or changed a part of its path, but came back with the original path/name.
I suppose that there is an issue with the hash code of that solution's path. As this is a professional project, I don't think I can publicly share its path. If I didn't mess up, its hash code should be 1196983195.

I just realized I think I understand the issue. In ColorCache.GetColor, Shouldn't :
int mod = hash % ColorMap.Count - 1;
be
int mod = hash % (ColorMap.Count - 1);
instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.