How to control the smart light (color , color tempreature, brightness) - actions-on-google

If the light is set to Red, and I want to modify the brightness.
But the Color Model(rgb or hsb) isn't support the brightness.same with color tempreature.
What should I do? Need to change to White light Model, then adjust the brightness?

So, you want to change the color and brightness both. If that is what you want to do then you have to implement two separate variables for brightness and color. The brightness cannot be controlled using just rgb or hsv, it uses separate variable and it ranges from 0-100.
Go through this:-
https://developers.google.com/actions/smarthome/traits/colorsetting

Related

How to generate Material Design Color set of selected color programmatically?

Question 1.
Let's assume the selected color is #a85c40.
Now, how can we generate the Material color with some nearby shade from that picked color. The nearby material shade will be like shade 800.
Question 2.
How to generate a colors sets of all colors with shade500 ?
You can use this tool to generate the colors.
You can use the colorScheme: property of the ThemeData() and pass a ColorScheme() object where you can set all the desired properties.
This video explains it https://www.youtube.com/watch?v=ZUi3hppgG2s

Flutter : Custom Painter draw path with different fill and stroke color

I am using the CustomPainter to draw a line chart where the line(stroke) needs to be of a different color and the fill color should be a different shade of it.
I could draw the chart but both with same colors.
However, I need the colors to be different.
How can I do this with a CustomPainter?
Also, I want to know how to have a single path painted with different colors instead of a single color if possible.
Thanks for your help!
I personally draw the stroke with "drawLine" calls and the fill with "drawPath".
You can define 2 different paints and use paint1 with "drawLine" and paint2 with "drawPath".

HTML5 Color Picker - color not changed

I've noticed a strange behavior with the color picker. When I pick any color from the basic colors (predefined colors), the button's color (the one of the html input element) is changed accordingly.
However, when picking any other color from the the gradient color picker, the button's color won't change. It will stay white. (Note: Don't pick a basic color first or refresh the jsbin page first if you're going to test it)
But... when I first pick a basic color and press OK and then pick a color from the gradient color picker, the button's color will change.
(Tested with Chrome 69)
Video (gif):
https://giphy.com/gifs/8vCEY7uyz8m17N0bkz
Test it:
http://output.jsbin.com/ivAhORu/1
var i = 0;
var inp=document.createElement("input");
inp.type = 'color';
inp.id = 'colo_'+i;
inp.value = '#ffffff';
inp.className = 'datafield';
document.body.appendChild(inp);
It's not actually an error, when you set a color picker to pure white or pure black the luminosity is adjusted to give you the desired color. When you pick a swatch the luminosity is changed to that swatch so it seems like it wasn't working before, but in fact it was working and if you adjusted the luminosity you'd see the color change correctly. You might want to consider a different starting color other than pure black or pure white.

How can I make each Packed Bubble a different color?

I have a Packed Bubble dashboard. My Y axis is a list of names and my X axis is a decimal. I want each differing number to be a different color. Can I do this manually?
If you want to color each bubble with a separate color just use the field that each bubble represent in the color shelf. If I understood your data correctly, each bubble basically represents one campaign, so you should use that as the color.
You can manually assign color using Color>Edit Color and assigning the color of your choice.
See image 1.
If you want to color your bubbles based on your measure AVg(NPV/Marketing $) you can do as Alex Blakemore mentioned and use your measure as a stepped color or gradient.
You can use Color>Edit Color here too , in this case manually assigning color is a bit difficult. But if you play with number of steps, the gradient pre-select, etc, you can usually get very close to what ever your wanted it to look like.
Put your numeric field on the color shelf, and either edit the colors to use a stepped set of colors - or change the field to be discrete and choose individual colors to taste.

How do I get a colored texture brush to show up in Open GL ES on white background?

I want to draw with a texture brush, in a color of my choice, on a white background using OpenGLES.
I have a bitmap image which I use CG to load and turn into a texture. This bitmap is mostly black, but has a white circle in the center that I want to use as the "brush". In other words, I want the black part to vanish in the final compositing, but the white part to take on the color that I set using glColor.
The best I can get is with the blend parameters (GL_SRC_ALPHA, GL_ONE) after setting some opaque bright color is a faded color line on a grey (not pure white background). But when I set the background to pure white, the line isn't visible.
At least in the current situation, the black edges of the original texture don't appear. Most other blend combinations I'm trying cause either nothing to show up even on grey, or to see the entire brush including the black edges, which is no good.
Is anyone willing to explain to me how I should set up my texture and/or GL states to make the bright color show through on pure white, without showing the black texture edges at all? This might be a newbie question, but I've tried working through the blend math, and I still just don't understand how the colors are all being factored together.
Here's the image I'm using as the brush:
alt text http://www.coldcoffeeandjuice.com/OpaqueBrush.png
Here's some resulting output, when the background is grey, and the glColor4f is set to (1, 0, 0, 1), eg pure red, and the brush is used on a bunch of consecutive GL_POINTs. Note that what's good about this is that only the white part of the brush image shows the color red-- that's right. The bad parts is that the red which I want to be pure and bright is pale due to being blended with the background (?) and/or the white of the brush (?) so that it washes out entirely if the background is pure white. This uses the blend params as given above (src_alpha, one).
(source: coldcoffeeandjuice.com)
Here's what I want to see, given the pure red color (thanks Paintbrush):
(source: coldcoffeeandjuice.com)
Can anyone help me understand what I'm doing wrong?
Thanks!
Ok, so you're trying to "paint" a given colour (in this case "red") on to a background, using a mask for the brush shape.
You need to do the following before you start rendering the "paint":
First make sure your brush has an alpha channel that corresponds with its shape - that is the alpha channel should look similar to the brush image you posed.
Render with these states set (note space to get around wiki markup):
// Make the current material colour track the current color
glEnable( GL_COLOR_MATERIAL );
// Multiply the texture colour by the material colour.
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
// Alpha blend each "dab" of paint onto background
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
See also:
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/colormaterial.html
http://www.khronos.org/opengles/documentation/opengles1_0/html/glTexEnv.html