Home | History | Annotate | Download | only in tools
      1 #!/bin/bash
      2 #
      3 # Copyright (C) 2017 The Android Open Source Project
      4 #
      5 # Licensed under the Apache License, Version 2.0 (the "License");
      6 # you may not use this file except in compliance with the License.
      7 # You may obtain a copy of the License at
      8 #
      9 #      http://www.apache.org/licenses/LICENSE-2.0
     10 #
     11 # Unless required by applicable law or agreed to in writing, software
     12 # distributed under the License is distributed on an "AS IS" BASIS,
     13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 # See the License for the specific language governing permissions and
     15 # limitations under the License.
     16 
     17 BASE="http://www.google.com/chart?chs=32&chst=d_simple_text_icon_above"
     18 
     19 #  From http://developers.google.com/chart/image/docs/gallery/dynamic_icons#basic-icons
     20 icons=(
     21    academy activities airport amusement aquarium
     22    art-gallery atm baby bank-dollar bank-euro
     23    bank-intl bank-pound bank-yen bar barber
     24    beach beer bicycle books bowling
     25    bus cafe camping car-dealer car-rental
     26    car-repair casino caution cemetery-grave cemetery-tomb
     27    cinema civic-building computer corporate courthouse
     28    fire flag floral helicopter home
     29    info landslide legal location locomotive
     30    medical mobile motorcycle music parking
     31    pet petrol phone picnic postal
     32    repair restaurant sail school scissors
     33    ship shoppingbag shoppingcart ski snack
     34    snow sport star swim taxi train
     35    truck wc-female wc-male wc
     36    wheelchair
     37    )
     38 
     39 # The 500s from https://spec.googleplex.com/quantumpalette#
     40 colors=(
     41     DB4437 E91E63 9C27B0 673AB7 3F51B5
     42     4285F4 03A9F4 00BCD4 009688 0F9D58
     43     8BC34A CDDC39 FFEB3B F4B400 FF9800
     44     FF5722 795548 9E9E9E 607D8B
     45 )
     46 
     47 
     48 # See https://developers.google.com/chart/image/docs/gallery/dynamic_icons
     49 for n in `seq 1 80`;
     50 do
     51   i=n%76
     52   c=$(($RANDOM%19))
     53   # <font_size>|<font_fill_color>|<icon_name>|<icon_size>|<icon_fill_color>|<icon_and_text_border_color>
     54   url=${BASE}"&chld=Ch+"${n}"|7|00F|${icons[${i}]}|24|${colors[${c}]}|FFF"
     55   echo ${url}
     56   curl ${url} -o tests/input/res/drawable-xhdpi/ch_${n}_logo.png
     57 done;