aboutsummaryrefslogtreecommitdiff
path: root/tests/input/tools/get_test_logos.sh
blob: 4dd87a3afedf738454d3ae05d49a2606e361ddaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
#
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

BASE="http://www.google.com/chart?chs=32&chst=d_simple_text_icon_above"

#  From http://developers.google.com/chart/image/docs/gallery/dynamic_icons#basic-icons
icons=(
   academy activities airport amusement aquarium
   art-gallery atm baby bank-dollar bank-euro
   bank-intl bank-pound bank-yen bar barber
   beach beer bicycle books bowling
   bus cafe camping car-dealer car-rental
   car-repair casino caution cemetery-grave cemetery-tomb
   cinema civic-building computer corporate courthouse
   fire flag floral helicopter home
   info landslide legal location locomotive
   medical mobile motorcycle music parking
   pet petrol phone picnic postal
   repair restaurant sail school scissors
   ship shoppingbag shoppingcart ski snack
   snow sport star swim taxi train
   truck wc-female wc-male wc
   wheelchair
   )

# The 500s from https://spec.googleplex.com/quantumpalette#
colors=(
    DB4437 E91E63 9C27B0 673AB7 3F51B5
    4285F4 03A9F4 00BCD4 009688 0F9D58
    8BC34A CDDC39 FFEB3B F4B400 FF9800
    FF5722 795548 9E9E9E 607D8B
)


# See https://developers.google.com/chart/image/docs/gallery/dynamic_icons
for n in `seq 1 80`;
do
  i=n%76
  c=$(($RANDOM%19))
  # <font_size>|<font_fill_color>|<icon_name>|<icon_size>|<icon_fill_color>|<icon_and_text_border_color>
  url=${BASE}"&chld=Ch+"${n}"|7|00F|${icons[${i}]}|24|${colors[${c}]}|FFF"
  echo ${url}
  curl ${url} -o tests/input/res/drawable-xhdpi/ch_${n}_logo.png
done;