Configure chat messages colors per brand.

This commit is contained in:
Paulo Reis 2017-12-13 13:21:42 +00:00
parent e47b20390b
commit c03ce6fdf7
2 changed files with 19 additions and 7 deletions

View file

@ -302,8 +302,8 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
westResizerCursor : if isOl then "ew-resize" else null
chatResizerSizeOpen : if isOl then 2 else 12
chatResizerSizeClosed : 0
chatMessageBorderSaturation: if isOl then 90 else 70
chatMessageBorderLightness : if isOl then 50 else 70
chatMessageBgSaturation : if isOl then 90 else 60
chatMessageBgLightness : if isOl then 50 else 97
chatMessageBorderSaturation: if isOl then "90%" else "70%"
chatMessageBorderLightness : if isOl then "50%" else "70%"
chatMessageBgSaturation : if isOl then "90%" else "60%"
chatMessageBgLightness : if isOl then "50%" else "97%"
next()

View file

@ -3,6 +3,12 @@ define [
"ide/colors/ColorManager"
], (App, ColorManager) ->
App.controller "ChatMessageController", ["$scope", "ide", ($scope, ide) ->
hslColorConfigs =
borderSaturation: window.uiConfig?.chatMessageBorderSaturation or "70%"
borderLightness : window.uiConfig?.chatMessageBorderLightness or "70%"
bgSaturation : window.uiConfig?.chatMessageBgSaturation or "60%"
bgLightness : window.uiConfig?.chatMessageBgLightness or "97%"
hue = (user) ->
if !user?
return 0
@ -10,9 +16,15 @@ define [
return ColorManager.getHueForUserId(user.id)
$scope.getMessageStyle = (user) ->
"border-color" : "hsl(#{ hue(user) }, 70%, 70%)"
"background-color" : "hsl(#{ hue(user) }, 60%, 97%)"
style =
"border-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.borderSaturation }, #{ hslColorConfigs.borderLightness })"
"background-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.bgSaturation }, #{ hslColorConfigs.bgLightness })"
console.log style
return style
$scope.getArrowStyle = (user) ->
"border-color" : "hsl(#{ hue(user) }, 70%, 70%)"
style =
"border-color" : "hsl(#{ hue(user) }, #{ hslColorConfigs.borderSaturation }, #{ hslColorConfigs.borderLightness })"
console.log style
return style
]