Change the background color of my Watson Virtual Agent - ibm-watson

I've created a bot using Watson Virtual Agent, and I embedded it in my website. Can I change the background color of the chat window so that it matches the other colors on my site?

You can certainly change the colors of the chat widget to match your brand.
In fact, every color that is used in the chat widget is configurable.
To choose your own colors, you can supply your own colors as part of your config object you pass to the IBMChat.init function.
The example below includes the default colors, but replace the hex codes as you see fit.
var config = {};
//set your other config params
config.styles = {
background: '#3d3d3d',
//the main background color
accentBackground: '#AF6EE8',
/*the background for "accent" elements.
These are the attention grabbing elements like a selected button,
or a loading spinner*/
accentText: '#ffffff',
//the text color for the accentBackground
text: '#ffffff',
//default text color
link: '#ffffff',
/*default link color... this should be a color that works both
with the "background" color and the "secondaryBackground" color.*/
secondaryBackground: '#464646',
/*this is the background for elements that get some emphasis,
but not as much as "accent" elements. e.g. An unselected button
or a container box for a widget.*/
secondaryText: '#f7f7f7',
inputBackground: '#464646',
//background color for your form elements, including the main chat input
inputText: '#f7f7f7'
}
IBMChat.init(config);

Related

How to change the icon or color of the icon for each file using material-ui-dropzone

I am using material-ui-dropzone to upload multiple files.
Is there any way to change the icon or color of the icon for each file?
Please give me suggestion to solve this problem.
Current situation -
Code example - Link
First if you see the example in the documentation https://react-dropzone.js.org/#section-previews
instead of using thumbnail use an icon from material UI and update the color programmatically.
Create a color pallet or a function that returns you the RGB programmatically. Then assign the color to each icon when you mount an icon component based on the number of file.
for simple one just create an array with color values:
const colorPallet = ['red', 'yello', 'green', ... ]
and assign the color in style <FileClipIcon style={{ color: colorPallet[index] }} />
otherwise write a function which returns you random RGB values between 0 to 255 and use that.

Replicating color box in VScode when writing CSS

I'm currently working on a project that basically shows a map. The map, image below, has different color gradients and I'd like to replicate the effect of vscode when you set color in css and it shows a little box that displays the color. I'd display that color and write a comment beside it.(I.E green = Great economy, light green = medium economy, and very light green = poor economy).
I'd really like to replicate the color display you see in vscode when you set color properties in css like this:
Open up settings in vs code (on a Mac, press command+comma)
Search for Color Decorators and check the box
More on vs code settings https://code.visualstudio.com/docs/getstarted/settings
I think you are asking about setting custom properties/variables in your CSS?
:root {
--some-yellow-you-name-here: #ffff00;
}
.you-class-name {
background-color: var(--some-yellow-you-name-here);
}

Same theme but different colors to choose from

Finally my app is almost done, and instead switching to others themes I would like to stick to Modern and change only combinations of colors.
My possible option are:
a) Make a copy of Theme to ModernA, ModernB, etc and change Color.js
b) Apply States to colors to select them according to some condition
c) Change them at runtime (if possible)
Which could be my easy and best approach to do it? and a snippet would be really appreciate.
The best way to do this is to create a new theme and reuse the modern theme; for example:
source/class/myapp/MyModern.js:
qx.Theme.define("myapp.MyModern", {
title : "My Modern",
meta : {
color : myapp.MyColor,
decoration : qx.theme.modern.Decoration,
font : qx.theme.modern.Font,
appearance : qx.theme.modern.Appearance,
icon : qx.theme.icon.Tango
}
});
and source/class/myapp/MyColor.js:
qx.Theme.define("myapp.MyColor", {
extend : qx.theme.modern.Color,
colors : {
// Add your custom colour overrides here
}
});
By using the extend keyword in the MyColor class, you will start with the normal Modern colours and can then choose to override colours as you need
Option C is possible by creating an edited Color theme at runtime:
// First, get the current Color theme
var currentcolor = qx.theme.manager.Color.getInstance().getTheme();
// Change any or all color entries. This can be as dynamic as you want. Get a user defined color from a color picker control. Create Shades based off of a primary color, etc.
currentcolor.colors.themePrimary = "#00ffd4"; // Or a value from the ColorPicker widget
// Now define a new Color theme with the updated colors
qx.Theme.define("NewColor",
{
colors : currentcolor.colors
});
// Set the new Color theme (button used below as an example)
button.addListener("execute", function(e) {
qx.theme.manager.Color.getInstance().setTheme(qx.Theme.getByName("NewColor"));
});

How to zoom into a series group by pressing on legend option in echarts

So I created a bar chart using echarts(v4.6.0) library inside Reactjs project. It has legend, data series chunked into groups with same colour and dataZoom slider. Every legend label corresponds to particular group of bars in the graph(they have same colours). However at the moment if user clicks on legend label, bars that correspond to this label disappears. What I want to achieve is when user clicks on legend label, the chart needs to zoom in to the group of bars that correspond to it instead of hiding them. Is there any way to do this?
In the common practice to make bar selected you can use the emphasis, it's style set activated by mouseover (something like rules declaration under :hover in CSS), for example (see tutorial):
itemStyle: {
// default styles
normal: {
shadowBlur: 200,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
// activated by mouseover
emphasis: {
shadowBlur: 200,
shadowColor: 'rgba(0, 0, 0, 0.8)'
}
}
If you need just to show bar in focus, it's easy:
Define emphasis styles.
Capture event legendselectchanged on legend component and suppress default behavior (see workaround) for prevent series disappear.
Dispatch highlight action for series or dataIndex and bar will be looks like selected.
I could be wrong, but as far as I know to zoom single (and stacked) bar it's not easy task. There are several unconventional ways like a draw resized bar clone above original, manipulations with datazoom component and recalculate/update bar data on mouseover and then return back old data on mouseout. Let me know if you choose one of these options I'm will try to help you.

CodenameOne - change color of checkbox in theme

I'm using the 'Blue Flat' theme in a cn1 project, and the checkboxes in a MultiButton component (I suppose following the Button text color) are completely white, making them invisible on a white background. I've tried changing their foreground color in the theme (in the GUI Builder theme tab), I tried replacing the theme files with checkboxes of a darker shade, but nothing seems to affect it.
How can I make the MultiButton checkbox a different color?
The blue theme customizes the checkbox image theme constant which you can remove at which case it should derive theme colors:
https://www.codenameone.com/manual/advanced-theming.html#_theme_constants
Just select the constants tab in the theme and remove the ones relevant to the checkbox.

Resources