No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

html_cell.awk 644B

hace 5 años
1234567891011121314151617181920212223242526272829303132333435
  1. #function abs(v) {return v < 0 ? -v : v}
  2. function ceil(x, y){y=int(x); return(x>y?y+1:y)}
  3. {
  4. ev=1e-2*$1
  5. error=1e-2*$2
  6. if (ev < -1)
  7. x=-1
  8. else if (ev > 1)
  9. x=1
  10. else
  11. x=ev
  12. # r=0.5-0.5*x
  13. # g=0.5+0.5*x
  14. # b=1-abs(x)
  15. pi = atan2(0, -1)
  16. r=cos((x+1)*pi/4)
  17. g=cos((x-1)*pi/4)
  18. b=0.4+0.2*cos(x*pi/2)
  19. if (error < 1e-6) {
  20. error=1e-4;
  21. }
  22. precision = (ceil(-log(error)/log(10)))-2;
  23. printf("<div class=\"text-center %s\" style='background-color: rgb(%d,%d,%d)'>", (ev<0)?"text-white":"", 255*r, 255*g, 255*b);
  24. printf(sprintf("%%+.%df", precision), 100*ev);
  25. printf("(%.0g)", 10^(precision+2) * error);
  26. printf("</div>");
  27. }