Skip to content

Commit

Permalink
Push with new license
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpk committed Sep 23, 2023
1 parent 6b37697 commit 660bd6a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = "unsvg"
version = "1.0.0"
edition = "2021"
description = "A simple SVG building library."
license = "Copyright © University of New South Wales."
authors = ["Tom Kunc <[email protected]>", "Zac Kologlu", "Shrey Somaiya <[email protected]>"]
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/unsvg"
homepage = "https://github.com/COMP6991UNSW/unsvg"
repository = "https://github.com/COMP6991UNSW/unsvg"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ repository [here](https://github.com/COMP6991UNSW/unsvg) and get involved.

## License

`unsvg` is Copyright © University of New South Wales.
`unsvg` is Copyright © University of New South Wales, licensed under MIT or Apache 2.0
at your option.
41 changes: 21 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,46 @@
use resvg::{usvg, tiny_skia};
use std::rc::Rc;
use resvg::usvg::{NodeExt, Transform, TreeWriting, XmlOptions, Stroke};
use resvg::usvg::{NodeExt, TreeWriting, XmlOptions};

pub use resvg::usvg::Color;


/// This contains 16 simple colors which users can select from.
/// These correspond to the 16 colors available in the original Logo language.
/// The colors are:
/// - Black
/// - Blue
/// - Green
/// - Cyan
/// - Red
/// - Magenta
/// - Yellow
/// - White
/// - Brown
/// - Tan
/// - Forest
/// - Aqua
/// - Salmon
/// - Purple
/// - Orange
/// - Grey
pub static COLORS: [Color; 16] = [
/// Black
Color {red: 0, green: 0, blue: 0},
/// Blue
Color {red: 0, green: 0, blue: 255},
/// Green
Color {red: 0, green: 255, blue: 0},
/// Cyan
Color {red: 0, green: 255, blue: 255},
/// Red
Color {red: 0, green: 255, blue: 0},
Color {red: 255, green: 0, blue: 0},
/// Magenta
Color {red: 255, green: 0, blue: 255},
/// Yellow
Color {red: 255, green: 255, blue: 0},
/// White
Color {red: 255, green: 255, blue: 255},
/// Brown
Color {red: 165, green: 42, blue: 42},
/// Tan
Color {red: 210, green: 180, blue: 140},
/// Forest
Color {red: 34, green: 139, blue: 34},
/// Aqua
Color {red: 127, green: 255, blue: 212},
/// Salmon
Color {red: 250, green: 128, blue: 114},
/// Purple
Color {red: 128, green: 0, blue: 128},
/// Orange
Color {red: 255, green: 165, blue: 0},
/// Grey
Color {red: 128, green: 128, blue: 128},
];

Expand Down Expand Up @@ -87,7 +88,7 @@ impl Image {
root: usvg::Node::new(usvg::NodeKind::Group(usvg::Group::default())),
};

let mut fill = usvg::Fill::from_paint(usvg::Paint::Color(usvg::Color::black()));
let fill = usvg::Fill::from_paint(usvg::Paint::Color(usvg::Color::black()));
let mut path = usvg::Path::new(Rc::from(tiny_skia::PathBuilder::from_rect(
size.to_non_zero_rect(0.0, 0.0).to_rect()
)));
Expand Down Expand Up @@ -145,7 +146,7 @@ impl Image {
pub fn draw_simple_line(&mut self, x: f32, y: f32, direction: i32, length: f32, color: Color) -> Result<(f32, f32), String> {
let x = quantize(x);
let y = quantize(y);
let mut paint = usvg::Paint::Color(color);
let paint = usvg::Paint::Color(color);

let mut path = tiny_skia::PathBuilder::new();
path.move_to(x, y);
Expand Down

0 comments on commit 660bd6a

Please sign in to comment.