Page 1 of 1

Bug em mudança de cor de objeto por script

Posted: Fri Apr 26, 2019 5:02 pm
by Guilherme_Barretta
Boa tarde,

Estou executando um script de mudança de cor de objeto porém a cor apresentada é diferente da cor relacionada ao código HTML, o que fazer nesse caso ? Tentei uma leve variação de cor e mesmo assim apresentou erro novamente.

Trecho de código referente a mudança de cor:

...

if val.Value == false then

scr.Shape_018.Brush.Color = 0xAAAAAA
scr.Shape_018.Pen.Color = 0xAAAAAA
scr.Shape_022.Brush.Color = 0xAAAAAA
scr.Shape_022.Pen.Color = 0xAAAAAA
scr.Shape_037.Brush.Color = 0xAAAAAA
scr.Shape_037.Pen.Color = 0xAAAAAA
scr.Shape_032.Brush.Color = 0xAAAAAA
scr.Shape_032.Pen.Color = 0xAAAAAA
scr.Shape_032.Brush.Color = 0xAAAAAA
scr.Shape_032.Pen.Color = 0xAAAAAA
scr.Shape_027.Brush.Color = 0xAAAAAA
scr.Shape_027.Pen.Color = 0xAAAAAA
scr.Shape_021.Brush.Color = 0xAAAAAA
scr.Shape_021.Pen.Color = 0xAAAAAA
scr.Shape_024.Brush.Color = 0xAAAAAA
scr.Shape_024.Pen.Color = 0xAAAAAA
scr.Shape_025.Brush.Color = 0xAAAAAA
scr.Shape_025.Pen.Color = 0xAAAAAA


else

scr.Shape_018.Brush.Color = 0x0BDA51
scr.Shape_018.Pen.Color = 0x0BDA51
scr.Shape_022.Brush.Color = 0x0BDA51
scr.Shape_022.Pen.Color = 0x0BDA51
scr.Shape_037.Brush.Color = 0x0BDA51
scr.Shape_037.Pen.Color = 0x0BDA51
scr.Shape_032.Brush.Color = 0x0BDA51
scr.Shape_032.Pen.Color = 0x0BDA51
scr.Shape_032.Brush.Color = 0x0BDA51
scr.Shape_032.Pen.Color = 0x0BDA51
scr.Shape_027.Brush.Color = 0x0BDA51
scr.Shape_027.Pen.Color = 0x0BDA51
scr.Shape_021.Brush.Color = 0x0BDA51
scr.Shape_021.Pen.Color = 0x0BDA51
scr.Shape_024.Brush.Color = 0x0BDA51
scr.Shape_024.Pen.Color = 0x0BDA51
scr.Shape_025.Brush.Color = 0x0BDA51
scr.Shape_025.Pen.Color = 0x0BDA51

end

Segue em anexo imagem para visualização do problema.

Re: Bug em mudança de cor de objeto por script

Posted: Tue Apr 30, 2019 11:32 am
by daniel_bable
Caro Guilherme, bom dia!

Em caso de mudança de cor via script é preciso inverter os bits.
Pois o script tem um tratamento diferente do HTML.

Tente passar a Cor desse jeito:

Invertendo os bits:

Atual = 0x0BDA51
Invertido = 0x51DA0B

Code: Select all

if val.Value == false then

scr.Shape_018.Brush.Color = 0xAAAAAA
scr.Shape_018.Pen.Color = 0xAAAAAA
scr.Shape_022.Brush.Color = 0xAAAAAA
scr.Shape_022.Pen.Color = 0xAAAAAA
scr.Shape_037.Brush.Color = 0xAAAAAA
scr.Shape_037.Pen.Color = 0xAAAAAA
scr.Shape_032.Brush.Color = 0xAAAAAA
scr.Shape_032.Pen.Color = 0xAAAAAA
scr.Shape_032.Brush.Color = 0xAAAAAA
scr.Shape_032.Pen.Color = 0xAAAAAA
scr.Shape_027.Brush.Color = 0xAAAAAA
scr.Shape_027.Pen.Color = 0xAAAAAA
scr.Shape_021.Brush.Color = 0xAAAAAA
scr.Shape_021.Pen.Color = 0xAAAAAA
scr.Shape_024.Brush.Color = 0xAAAAAA
scr.Shape_024.Pen.Color = 0xAAAAAA
scr.Shape_025.Brush.Color = 0xAAAAAA
scr.Shape_025.Pen.Color = 0xAAAAAA


else

scr.Shape_018.Brush.Color = 0x51DA0B
scr.Shape_018.Pen.Color = 0x51DA0B
scr.Shape_022.Brush.Color = 0x51DA0B
scr.Shape_022.Pen.Color = 0x51DA0B
scr.Shape_037.Brush.Color = 0x51DA0B
scr.Shape_037.Pen.Color = 0x51DA0B
scr.Shape_032.Brush.Color = 0x51DA0B
scr.Shape_032.Pen.Color = 0x51DA0B
scr.Shape_032.Brush.Color = 0x51DA0B
scr.Shape_032.Pen.Color = 0x51DA0B
scr.Shape_027.Brush.Color = 0x51DA0B
scr.Shape_027.Pen.Color = 0x51DA0B
scr.Shape_021.Brush.Color = 0x51DA0B
scr.Shape_021.Pen.Color = 0x51DA0B
scr.Shape_024.Brush.Color = 0x51DA0B
scr.Shape_024.Pen.Color = 0x51DA0B
scr.Shape_025.Brush.Color = 0x51DA0B
scr.Shape_025.Pen.Color = 0x51DA0B

end

Em caso de novas dúvidas, basta utilizar nosso fórum!