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


Załączone pliki
.zip   jscolor.zip (Rozmiar: 13.03 KB / Pobrań: 0)
Odpowiedz
#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


Skocz do:


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