/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.

    Created on : 12-may-2017, 9:28:07
    Author     : Tatiana
 
        Recuperar datos a mano: 15-05-17
*/
@mixin borderRadius($type){
    -webkit-border-radius: $type;
    -moz-border-radius: $type;
    border-radius: $type;
}
@mixin boxShadow($type){
    -webkit-box-shadow: $type;
    -moz-box-shadow:    $type;
    box-shadow:         $type;
}

@function decToHex($dec) {
    $hex: "0123456789ABCDEF";
    $first: (($dec-$dec%16)/16)+1;
    $second: ($dec%16)+1;
    @return number(str-slice($hex, $first, $first) + str-slice($hex, $second, $second));
}

@function number($value) {
  @if type-of($value) == 'number' {
    @return $value;
  } @else if type-of($value) != 'string' {
    $_: log('Value for `to-number` should be a number or a string.');
  }
  
  $result: 0;
  $digits: 0;
  $minus: str-slice($value, 1, 1) == '-';
  $numbers: ('0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9);
  
  @for $i from if($minus, 2, 1) through str-length($value) {
    $character: str-slice($value, $i, $i);
    
    @if not (index(map-keys($numbers), $character) or $character == '.') {
      @return to-length(if($minus, -$result, $result), str-slice($value, $i))
    }
    
    @if $character == '.' {
      $digits: 1; 
    } @else if $digits == 0 {
      $result: $result * 10 + map-get($numbers, $character);  
    } @else {
      $digits: $digits * 10;
      $result: $result + map-get($numbers, $character) / $digits;
    }
  }
  
  @return if($minus, -$result, $result);
}
