Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
[JS] Color Picker - rgb
#2
Już sobie poradziłem.

W kodzie szablonu należy zmienić to:
Kod PHP:
document.getElementById('red').value this.color.rgb[0]*100 '%';
        
document.getElementById('grn').value this.color.rgb[1]*100 '%';
        
document.getElementById('blu').value this.color.rgb[2]*100 '%'

na to:

Kod PHP:
document.getElementById('red').value Math.round(this.color.rgb[0]*250);
        
document.getElementById('grn').value Math.round(this.color.rgb[1]*250);
        
document.getElementById('blu').value Math.round(this.color.rgb[2]*250); 

Teraz (dla koloru #4AE632 ) zamiast odczytu:

Kod PHP:
R29.01960784313726%
G90.19607843137256%
B19.607843137254903

mam:
Kod PHP:
R73
G
225
B
49 

Zamiast parametru "100" użyłem "250".
Odpowiedz


Wiadomości w tym wątku
[JS] Color Picker - rgb - przez piottro1 - 01-11-2011, 10:34
RE: [JS] Color Picker - rgb - przez piottro1 - 01-11-2011, 22:24

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości
Sponsorzy i przyjaciele
SeoHost.pl