Example usage for android.graphics Color CYAN

List of usage examples for android.graphics Color CYAN

Introduction

In this page you can find the example usage for android.graphics Color CYAN.

Prototype

int CYAN

To view the source code for android.graphics Color CYAN.

Click Source Link

Usage

From source file:Main.java

public static int getRandomColor() {
    List<Integer> colors = new ArrayList<>();
    colors.add(Color.BLACK);//from  w w  w  . jav  a  2  s  .c om
    colors.add(Color.RED);
    colors.add(Color.GREEN);
    colors.add(Color.BLUE);
    colors.add(Color.YELLOW);
    colors.add(Color.GRAY);
    colors.add(Color.MAGENTA);
    colors.add(Color.CYAN);
    colors.add(Color.LTGRAY);
    return colors.get(new Random().nextInt(colors.size()));
}

From source file:Main.java

public static Bitmap getHistogram(Bitmap bmpOriginal) {

    //Scale bmpOriginal to improve performance 
    final int dstWidth = 200;
    int dstHeight = dstWidth * bmpOriginal.getHeight() / bmpOriginal.getWidth();
    Bitmap bmpScaled = Bitmap.createScaledBitmap(bmpOriginal, dstWidth, dstHeight, false);
    int[] histogramValues = new int[256];

    int[] pixels = new int[dstWidth];
    int pxBrightness;
    for (int row = 0; row < dstHeight; row++) {
        bmpScaled.getPixels(pixels, 0, dstWidth, 0, row, dstWidth, 1);
        for (int col = 0; col < dstWidth; col++) {
            pxBrightness = rgbToGray(pixels[col]);
            histogramValues[pxBrightness]++;
        }/*from w  w w  .j a va2 s  .c  o  m*/
    }
    bmpScaled.recycle();

    int histogramMax = max(histogramValues);
    Bitmap bmpHistogram = Bitmap.createBitmap(256, histogramMax, Config.ARGB_8888);
    Canvas canvas = new Canvas(bmpHistogram);
    Paint paint = new Paint();
    paint.setColor(Color.CYAN);

    for (int i = 0; i < 256; i++)
        canvas.drawLine(i, histogramMax - histogramValues[i], i, histogramMax, paint);

    return bmpHistogram;
}

From source file:CustomView.java

@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    setBackgroundColor(Color.CYAN);
    canvas.drawText("Custom Text", 100, 100, mPaint);
}

From source file:com.google.android.apps.santatracker.doodles.tilt.StickyActor.java

public StickyActor(Polygon collisionBody) {
    super(collisionBody);
    // cyan, yellow, semi-transparent green.
    collisionBody.setPaintColors(Color.CYAN, 0xffffff00, 0x6400ff00);
}

From source file:com.tfc.baseandroid.ui.fragment.FragmentA.java

@SuppressLint("SetTextI18n")
@Nullable//from w  ww.  j  a  va2 s . c  o  m
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.f_fragment, container, false);

    FrameLayout flRoot = (FrameLayout) view.findViewById(R.id.f_fragment_fl_root);
    TextView tvTitle = (TextView) view.findViewById(R.id.f_fragment_tv_title);

    flRoot.setBackgroundColor(Color.CYAN);
    tvTitle.setText("Fragment A");

    return view;
}

From source file:com.example.sample2.MainActivity.java

private void setActionBarTitle() {
    if (getSupportActionBar() == null)
        return;//from  www. ja  va  2 s.c o  m
    TypefaceSpan span = new TypefaceSpan(this, "Audiowide-Regular");
    ForegroundColorSpan colorSpan = new ForegroundColorSpan(Color.CYAN);

    SpannableString title = new SpannableString("TextViews2");
    title.setSpan(span, 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    title.setSpan(colorSpan, 4, title.length() - 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    getSupportActionBar().setTitle(title);
}

From source file:ca.farrelltonsolar.classic.MonitorActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    navigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager()
            .findFragmentById(R.id.navigation_drawer);
    // Set up the drawer.
    DrawerLayout layout = (DrawerLayout) findViewById(R.id.drawer_layout);
    navigationDrawerFragment.setUp(R.id.navigation_drawer, layout);
    stl = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
    stl.setDividerColors(Color.RED);
    stl.setSelectedIndicatorColors(Color.BLUE, Color.CYAN, Color.GREEN, Color.MAGENTA, Color.YELLOW);
    viewPager = (ViewPager) findViewById(R.id.pager);
    setupActionBar();//from w w w  .ja v a 2 s  .c o  m
    Log.d(getClass().getName(), "onCreate");
}

From source file:com.crs4.roodin.moduletester.CustomView.java

/**
 * @param context/*  w  w w.j a va 2 s . c  o m*/
 */
public CustomView(Context context) {
    super(context);
    blockImg = BitmapFactory.decodeResource(context.getResources(), R.drawable.block); //carichiamo l'immagine in una bitmap

    mBmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_132); //carichiamo l'immagine in una bitmap
    bw = mBmp.getWidth(); //larghezza bitmap
    bh = mBmp.getHeight();//altezza   
    mPaint = new Paint(); // pennello
    mPaint.setColor(Color.CYAN);
    mPaint.setAntiAlias(true);
    mRnd = new Random();

}

From source file:in.trycatchthrow.trouvaille.MyGcmListenerService.java

/**
 * Create and show a simple notification containing the received GCM message.
 *
 * @param message GCM message received./*from  w ww . j  a  va 2  s .com*/
 */
private void sendNotification(String message) {
    Intent intent = new Intent(this, MainActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
            PendingIntent.FLAG_ONE_SHOT);

    Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.settings).setContentTitle("GCM Message").setContentText(message)
            .setColor(Color.CYAN).setAutoCancel(true).setSound(defaultSoundUri).setContentIntent(pendingIntent);

    NotificationManager notificationManager = (NotificationManager) getSystemService(
            Context.NOTIFICATION_SERVICE);

    //Log.d(TAG, message);
    notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
}

From source file:de.quist.app.maps.example.PolygonDemoActivity.java

@Override
public void onMapReady(Map map) {
    // Override the default content description on the view, for accessibility mode.
    // Ideally this string would be localised.
    map.setContentDescription("Google Map with polygons.");

    // Create a rectangle with two rectangular holes.
    map.addPolygon(BuildConfig.MAP_BINDING.newPolygonOptions()
            .addAll(createRectangle(BuildConfig.MAP_BINDING.newLatLng(-20, 130), 5, 5))
            .addHole(createRectangle(BuildConfig.MAP_BINDING.newLatLng(-22, 128), 1, 1))
            .addHole(createRectangle(BuildConfig.MAP_BINDING.newLatLng(-18, 133), 0.5, 1.5))
            .fillColor(Color.CYAN).strokeColor(Color.BLUE).strokeWidth(5));

    // Create a rectangle centered at Sydney.
    PolygonOptions options = BuildConfig.MAP_BINDING.newPolygonOptions().addAll(createRectangle(SYDNEY, 5, 8));

    int fillColor = Color.HSVToColor(mAlphaBar.getProgress(), new float[] { mColorBar.getProgress(), 1, 1 });
    mMutablePolygon = map.addPolygon(/*from   ww  w . jav  a2 s. co m*/
            options.strokeWidth(mWidthBar.getProgress()).strokeColor(Color.BLACK).fillColor(fillColor));

    mColorBar.setOnSeekBarChangeListener(this);
    mAlphaBar.setOnSeekBarChangeListener(this);
    mWidthBar.setOnSeekBarChangeListener(this);

    // Move the map so that it is centered on the mutable polygon.
    map.moveCamera(BuildConfig.MAP_BINDING.cameraUpdateFactory().newLatLng(SYDNEY));
}