Flutter Engine
The Flutter Engine
Color.java
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8package org.skia.jetski;
9
10public class Color {
11 private float mR, mG, mB, mA;
12
13 public Color(float r, float g, float b, float a) {
14 mR = r;
15 mG = g;
16 mB = b;
17 mA = a;
18 }
19
20 public Color() {
21 this(0, 0, 0, 1);
22 }
23
24 /*
25 * Converts int given by android.graphics.Color
26 * to JetSki Color
27 */
28 public Color(int color) {
29 mA = ((color >> 24) & 0xff) / 255.f;
30 mR = ((color >> 16) & 0xff) / 255.f;
31 mG = ((color >> 8) & 0xff) / 255.f;
32 mB = ((color) & 0xff) / 255.f;
33 }
34
35 public float r() { return mR; }
36 public float g() { return mG; }
37 public float b() { return mB; }
38 public float a() { return mA; }
39
40 public void setR(float r) { mR = r; }
41 public void setG(float g) { mG = g; }
42 public void setB(float b) { mB = b; }
43 public void setA(float a) { mA = a; }
44}
Color(int color)
Definition: Color.java:28
Color(float r, float g, float b, float a)
Definition: Color.java:13
void setG(float g)
Definition: Color.java:41
void setA(float a)
Definition: Color.java:43
void setB(float b)
Definition: Color.java:42
void setR(float r)
Definition: Color.java:40
DlColor color