Bug em mudança de cor de objeto por script

Post Reply
Guilherme_Barretta
Posts: 7
Joined: Fri Apr 26, 2019 4:31 pm

Bug em mudança de cor de objeto por script

Post 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.
Attachments
color.png
color.png (34.25 KiB) Viewed 5088 times
User avatar
daniel_bable
Moderadores
Posts: 47
Joined: Wed Jun 19, 2013 1:06 am

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

Post 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!
Daniel Bable Franco
Analista em Automação

HI Tecnologia - Indústria e Comércio Ltda
Campinas - SP
Fone: +55 (19) 2139-1700
Email: daniel.franco@hitecnologia.com.br
Web-site: http://www.hitecnologia.com.br
Post Reply