Warm tip: This article is reproduced from serverfault.com, please click

botframework-Directline Bot-如何更改用户气泡的字体颜色

(botframework - Directline bot- How to change the font color for user's bubble)

发布于 2020-12-01 14:05:30

我正在尝试自定义聊天机器人的UI。因为我目前只能更改用户气泡的字体颜色。默认情况下,字体颜色设置为黑色,我想更改为白色,我可以使用以下样式选项来更改气泡背景颜色。

    const styleSet = window.WebChat.createStyleSet({
        
        bubbleBackground: 'rgba(0, 0, 255, .1)', 
      bubbleFromUserBackground: 'rgba(0, 255, 0, .1)'

    });

可以通过正确的语法帮助用户和Bot气泡更改字体颜色吗?

Questioner
Jegan Baskaran
Viewed
11
Steven Kanberg 2020-12-02 06:26:55

如你在Web聊天库中的defaultStyleOptions.js中所看到的,有许多内置且可访问的样式选项。你所需要做的就是分别针对用户气泡或机器人气泡bubbleFromUserTextColorbubbleTextColor属性。

const styleSet = window.WebChat.createStyleSet({
        
  bubbleBackground: 'rgba(0, 0, 255, .1)',
  bubbleTextColor: 'rgba(0, 0, 0, 1)',
  bubbleFromUserBackground: 'rgba(0, 255, 0, .1)',
  bubbleFromUserTextColor: 'rgba(0, 0, 0, 1)'

});

希望有帮助!