-
-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyRevit icons on the ribbon are barely visible when Revit 2024 dark theme enabled #1834
Comments
@shtirlitsDva do you have a proposal to fix this? |
I am sorry, no. |
I tried to recolor the icons for that specific purpose with this script. We would need to discuss it with @eirannejad if there is a better way than recoloring all the icons: from PIL import Image, ImageDraw
import os
def grey_icons(input_path, output_path):
image = Image.open(input_path).convert("RGBA")
if input_path.endswith("icon.png"):
new_image = Image.new("RGBA", image.size, (0, 0, 0, 0))
draw = ImageDraw.Draw(new_image)
greying_color = (243,243,243)
for x in range(image.width):
for y in range(image.height):
r, g, b, a = image.getpixel((x, y))
if a > 0:
draw.point((x, y), fill=greying_color + (a,))
new_image.save(output_path)
else:
image.save(output_path)
def add_stroke(input_path, output_path, stroke_width=1):
image = Image.open(input_path).convert("RGBA")
new_image = Image.new("RGBA", image.size, (0, 0, 0, 0))
draw = ImageDraw.Draw(new_image)
colored_pixels = image.convert("L").point(lambda x: 0 if x == 0 else 255, mode="1")
new_image.paste(image, (0, 0), mask=image)
for x in range(image.width):
for y in range(image.height):
if colored_pixels.getpixel((x, y)):
for dx in range(-stroke_width, stroke_width + 1):
for dy in range(-stroke_width, stroke_width + 1):
if dx == 0 and dy == 0:
continue
nx, ny = x + dx, y + dy
if nx < 0 or ny < 0 or nx >= image.width or ny >= image.height or not colored_pixels.getpixel((nx, ny)):
draw.point((x, y), fill=(0, 0, 0))
final_image = Image.alpha_composite(image, new_image)
final_image.save(output_path)
input_directory = "C:\pyRevit\latest\latest\extensions\pyRevitTools.extension\pyRevit.tab"
output_directory = "C:\pyRevit\latest\latest\extensions\pyRevitTools.extension\pyRevit.tab"
stroke_width = 1
for root, dirs, files in os.walk(input_directory):
for filename in files:
if filename.endswith(".png"):
input_path = os.path.join(root, filename)
relative_path = os.path.relpath(input_path, input_directory)
output_path = os.path.join(output_directory, relative_path)
os.makedirs(os.path.dirname(output_path), exist_ok=True)
grey_icons(input_path, output_path)
add_stroke(output_path, output_path, stroke_width) |
@jmcouffin, |
@dosymep can you elaborate on the usage of dark vs fatal, regular and warning? |
icon - default for light theme |
use case missing is on and off toggle in dark theme |
I think need to use suffix dark for dark theme. |
A very generic way to do this, could be to invert the brightness while preserving the hue. Should also work for icons. Similar to how these guys are doing it: Actually looks good even for more complex icons: |
I think it makes sense to do both. This ofcourse wouldn't fix issues with icons that work just fine in dark and light mode. But then you could argue that the easy fix for that is to just provide icon.dark.png as an exact copy of icon.png |
@dosymep do you have the implementation for .dark somewhere already coded? |
@jmcouffin, I am using this icon only in notifications |
@GertjanVDBVK, invert colors great idea, but I think bad to performance, cold start pyrevit will be so terrible |
Fixed by @dosymep by #1897 🍾 🙏 🎉
How do I get this change?
|
sorry i dont find them under %appdata%/pyrevit folder. im using the non-admin version, what is the typical path?? |
Please open a new issue and follow the issue guidelines |
my bad, apologize again. found them under our issue |
https://github.com/eirannejad/pyRevit/blob/develop/extras/dark_mode/convert_icon_to_dark_mode.py |
You are right, thanks |
Describe the bug
PyRevit icons on the ribbon are barely visible when Revit 2024 dark theme is enabled
To Reproduce
Steps to reproduce the behavior:
Install Revit 2024
Install PyRevit (I installed 9266f6a develop)
Expected behavior
I expect the icons to be visible in Dark mode.
Screenshots
Desktop (please complete the following information):
´´´
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.13.23144+1030-wip" | Path: "C:\Users\MichailGolubjev\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2024" | Engine: IPY277 (277) | Path: "C:\Users\MichailGolubjev\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
DRIEXT | Type: Unknown | Repo: "" | Installed: "X:\AutoCAD DRI - Revit\pyRevitExtensions\DRIEXT.extension"
==> Default Extension Search Path
C:\Users\MichailGolubjev\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
X:\AutoCAD DRI - Revit\pyRevitExtensions
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2024 | Version: 24.0.5.432 | Build: 20230411_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024"
==> Running Revit Instances
Error: Objektreferencen er ikke indstillet til en forekomst af et objekt.
Run with "--debug" option to see debug messages
´´´
The text was updated successfully, but these errors were encountered: