Skip to content

Commit

Permalink
Fix color helper
Browse files Browse the repository at this point in the history
  • Loading branch information
danidoni committed Aug 6, 2024
1 parent 6e2a68d commit c15c123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/helpers/webui/color_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Webui::ColorHelper
# Calculates a text color that will contrast well with the given color
def contrast_text(color)
color = color.to_i
color = color.delete('#').to_i(16)
blue_component = color % 0x100
color_without_blue = ((color - blue_component) / 0x100)
green_component = color_without_blue % 0x100
Expand Down

0 comments on commit c15c123

Please sign in to comment.